本文整理汇总了PHP中PHPUnit_Util_XML::loadFile方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Util_XML::loadFile方法的具体用法?PHP PHPUnit_Util_XML::loadFile怎么用?PHP PHPUnit_Util_XML::loadFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Util_XML
的用法示例。
在下文中一共展示了PHPUnit_Util_XML::loadFile方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGenerateClover
/**
* @dataProvider getReporterProvider
*
* @param string[] $coverageFiles
*/
public function testGenerateClover(array $coverageFiles)
{
$filename1 = $this->copyCoverageFile($coverageFiles[0], $this->targetDir);
$filename2 = $this->copyCoverageFile($coverageFiles[1], $this->targetDir);
$coverageMerger = new CoverageMerger();
$coverageMerger->addCoverageFromFile($filename1);
$coverageMerger->addCoverageFromFile($filename2);
$target = $this->targetDir . '/coverage.xml';
static::assertFileNotExists($target);
$coverageMerger->getReporter()->clover($target);
static::assertFileExists($target);
$reportXml = \PHPUnit_Util_XML::loadFile($target);
static::assertInstanceOf('DomDocument', $reportXml, 'Incorrect clover report xml was generated');
}
示例2: __construct
/**
* Loads a PHPUnit configuration file.
*
* @param string $filename
*/
protected function __construct($filename)
{
$this->filename = $filename;
$this->document = PHPUnit_Util_XML::loadFile($filename);
$this->xpath = new DOMXPath($this->document);
}
示例3: runSelenese
/**
* Runs a test from a Selenese (HTML) specification.
*
* @param string $filename
*/
public function runSelenese($filename)
{
$document = PHPUnit_Util_XML::loadFile($filename, TRUE);
$xpath = new DOMXPath($document);
$rows = $xpath->query('body/table/tbody/tr');
foreach ($rows as $row) {
$action = NULL;
$arguments = array();
$columns = $xpath->query('td', $row);
foreach ($columns as $column) {
if ($action === NULL) {
$action = PHPUnit_Util_XML::nodeToText($column);
} else {
$arguments[] = PHPUnit_Util_XML::nodeToText($column);
}
}
if (method_exists($this, $action)) {
call_user_func_array(array($this, $action), $arguments);
} else {
$this->__call($action, $arguments);
}
}
}
示例4: assertXmlStringNotEqualsXmlFile
/**
* Asserts that two XML documents are not equal.
*
* @param string $expectedFile
* @param string $actualXml
* @param string $message
*
* @since Method available since Release 3.3.0
*/
public static function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '')
{
$expected = PHPUnit_Util_XML::loadFile($expectedFile);
$actual = PHPUnit_Util_XML::load($actualXml);
self::assertNotEquals($expected, $actual, $message);
}
示例5: loadFile
/**
* @param $filename
* @param bool|false $isHtml
* @param bool|false $xinclude
* @param bool|false $strict
*
* @return \DOMDocument
*/
public function loadFile($filename, $isHtml = false, $xinclude = false, $strict = false)
{
return \PHPUnit_Util_XML::loadFile($filename, $isHtml, $xinclude, $strict);
}
示例6: getStubbedXMLConf
/**
* @param string $fileName
*
* @return string
*
* @throws \Exception
*/
private function getStubbedXMLConf($fileName)
{
$filePath = realpath($fileName);
if (!file_exists($filePath)) {
throw new \Exception('Stub XML config file missing: ' . $fileName);
}
return \PHPUnit_Util_XML::loadFile($filePath, false, true, true);
}