本文整理汇总了PHP中PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile方法的具体用法?PHP PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile怎么用?PHP PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSign
public function testSign()
{
$adapter = $this->getAdapter();
$data = new DOMDocument();
$data->load(__DIR__ . '/_files/basic-doc.xml');
$adapter->setPrivateKey($this->getPrivateKey());
$adapter->setPublicKey($this->getPublicKey());
$adapter->addTransform(AdapterInterface::ENVELOPED);
$adapter->setCanonicalMethod('http://www.w3.org/2001/10/xml-exc-c14n#');
$adapter->sign($data);
Assert::assertXmlStringEqualsXmlFile(__DIR__ . '/_files/basic-doc-signed.xml', $data->saveXML());
}
示例2: testRead
public function testRead()
{
$expectedResult = new \stdClass();
$constraint = function (\DOMDocument $actual) {
try {
$expected = __DIR__ . '/_files/formats_merged.xml';
\PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile($expected, $actual->saveXML());
return true;
} catch (\PHPUnit_Framework_AssertionFailedError $e) {
return false;
}
};
$this->_converter->expects($this->once())->method('convert')->with($this->callback($constraint))->will($this->returnValue($expectedResult));
$this->assertSame($expectedResult, $this->_model->read('scope'));
}
示例3: assertXmlStringEqualsXmlFile
/**
* Asserts that two XML documents are equal.
*
* @param string $expectedFile
* @param string $actualXml
* @param string $message
* @since Method available since Release 3.3.0
*/
function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '')
{
return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message);
}
示例4: isEqualToXmlFile
public function isEqualToXmlFile($file)
{
Assert::assertXmlStringEqualsXmlFile($file, $this->actual, $this->description);
return $this;
}
示例5: equalsXmlFile
public function equalsXmlFile($file)
{
if (!$this->isFileExpectation) {
a::assertXmlStringEqualsXmlFile($file, $this->actual, $this->description);
} else {
a::assertXmlFileEqualsXmlFile($file, $this->actual, $this->description);
}
}
示例6: toEqualXmlFile
/**
* Expect that two XML files or documents are equal.
*
* @param string $expectedFile
* @param string $message
*
* @return Expect
*/
public function toEqualXmlFile($expectedFile, $message = '')
{
if (file_exists($this->value)) {
// file
Assert::assertXmlFileEqualsXmlFile($expectedFile, $this->value, $message);
} else {
// string
Assert::assertXmlStringEqualsXmlFile($expectedFile, $this->value, $message);
}
return $this;
}
示例7: assertXmlStringEqualsVfsXmlFile
/**
* Asserts that two vfs XML documents are equal.
*
* @param $expectedFile
* @param $actualXml
* @param string $message
*/
public function assertXmlStringEqualsVfsXmlFile($expectedFile, $actualXml, $message = '')
{
PHPUnit::assertXmlStringEqualsXmlFile($this->getPath($expectedFile), $actualXml, $message);
}