本文整理汇总了PHP中PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString方法的具体用法?PHP PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString怎么用?PHP PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertEquals
public static function assertEquals(TestRequestResponse $expected, TestRequestResponse $actual, $message = false)
{
$expectedText = $expected->getResponseText();
$actualText = $actual->getResponseText();
if ($expected->requestUrl['format'] == 'xml') {
Asserts::assertXmlStringEqualsXmlString($expectedText, $actualText, $message);
} else {
Asserts::assertEquals(strlen($expectedText), strlen($actualText), $message);
Asserts::assertEquals($expectedText, $actualText, $message);
}
}
示例2: assertEquals
public static function assertEquals(Response $expected, Response $actual, $message = false)
{
$expectedText = $expected->getResponseText();
$actualText = $actual->getResponseText();
if ($expected->requestUrl['format'] == 'xml') {
Asserts::assertXmlStringEqualsXmlString($expectedText, $actualText, $message);
return;
}
// check content size to get quick feedback and avoid lengthy diff
$checkSizeFirst = array('pdf', 'csv', 'html');
if (!empty($expected->requestUrl['reportFormat']) && in_array($expected->requestUrl['reportFormat'], $checkSizeFirst)) {
Asserts::assertEquals(strlen($expectedText), strlen($actualText), $message);
}
Asserts::assertEquals($expectedText, $actualText, $message);
}
示例3: testRead
public function testRead()
{
$this->read->expects($this->at(0))->method('readAll')->will($this->returnValue(file_get_contents($this->_paths[0])));
$this->read->expects($this->at(1))->method('readAll')->will($this->returnValue(file_get_contents($this->_paths[1])));
$this->_moduleDirResolver->expects($this->at(0))->method('getModuleName')->with(__DIR__ . '/_files/Fixture/ModuleOne/etc/email_templates_one.xml')->will($this->returnValue('Fixture_ModuleOne'));
$this->_moduleDirResolver->expects($this->at(1))->method('getModuleName')->with(__DIR__ . '/_files/Fixture/ModuleTwo/etc/email_templates_two.xml')->will($this->returnValue('Fixture_ModuleTwo'));
$constraint = function (\DOMDocument $actual) {
try {
$expected = file_get_contents(__DIR__ . '/_files/email_templates_merged.xml');
$expectedNorm = preg_replace('/xsi:noNamespaceSchemaLocation="[^"]*"/', '', $expected, 1);
$actualNorm = preg_replace('/xsi:noNamespaceSchemaLocation="[^"]*"/', '', $actual->saveXML(), 1);
\PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString($expectedNorm, $actualNorm);
return true;
} catch (\PHPUnit_Framework_AssertionFailedError $e) {
return false;
}
};
$expectedResult = new \stdClass();
$this->_converter->expects($this->once())->method('convert')->with($this->callback($constraint))->will($this->returnValue($expectedResult));
$this->assertSame($expectedResult, $this->_model->read('scope'));
}
示例4: assertXmlStringEqualsXmlString
/**
* Asserts that two XML documents are equal.
*
* @param string $expectedXml
* @param string $actualXml
* @param string $message
* @since Method available since Release 3.1.0
*/
function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '')
{
return PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message);
}
示例5: seeXmlResponseEquals
/**
* Checks XML response equals provided XML.
* Comparison is done by canonicalizing both xml`s.
*
* Parameters can be passed either as DOMDocument, DOMNode, XML string, or array (if no attributes).
*
* @param $xml
* @part xml
*/
public function seeXmlResponseEquals($xml)
{
\PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString($this->response, $xml);
}
示例6: seeXmlResponseEquals
/**
* Checks XML response equals provided XML.
* Comparison is done by canonicalizing both xml`s.
*
* Parameters can be passed either as DOMDocument, DOMNode, XML string, or array (if no attributes).
*
* @param $xml
* @part xml
*/
public function seeXmlResponseEquals($xml)
{
\PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString($this->connectionModule->_getResponseContent(), $xml);
}
示例7: isEqualToXmlString
public function isEqualToXmlString($xmlString)
{
Assert::assertXmlStringEqualsXmlString($xmlString, $this->actual, $this->description);
return $this;
}
示例8: equalsXmlString
public function equalsXmlString($xmlString)
{
a::assertXmlStringEqualsXmlString($xmlString, $this->actual, $this->description);
}
示例9: toEqualXml
/**
* Expect that two XML documents are equal.
*
* @param string $expectedXml
* @param string $message
*
* @return Expect
*/
public function toEqualXml($expectedXml, $message = '')
{
Assert::assertXmlStringEqualsXmlString($expectedXml, $this->value, $message);
return $this;
}