当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:11,代码来源:TestRequestResponse.php

示例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);
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:15,代码来源:Response.php

示例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'));
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:21,代码来源:ReaderTest.php

示例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);
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:12,代码来源:Functions.php

示例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);
 }
开发者ID:corcre,项目名称:elabftw,代码行数:13,代码来源:REST.php

示例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);
 }
开发者ID:surjit,项目名称:Codeception,代码行数:13,代码来源:REST.php

示例7: isEqualToXmlString

 public function isEqualToXmlString($xmlString)
 {
     Assert::assertXmlStringEqualsXmlString($xmlString, $this->actual, $this->description);
     return $this;
 }
开发者ID:dekeysoft,项目名称:pu-tester,代码行数:5,代码来源:StringMatcher.php

示例8: equalsXmlString

 public function equalsXmlString($xmlString)
 {
     a::assertXmlStringEqualsXmlString($xmlString, $this->actual, $this->description);
 }
开发者ID:jaschweder,项目名称:Verify,代码行数:4,代码来源:Verify.php

示例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;
 }
开发者ID:jpkleemans,项目名称:phpunit-expect,代码行数:13,代码来源:Expect.php


注:本文中的PHPUnit_Framework_Assert::assertXmlStringEqualsXmlString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。