PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile PHP Method

assertXmlStringEqualsXmlFile() public static method

Asserts that two XML documents are equal.
public static assertXmlStringEqualsXmlFile ( string $expectedFile, string $actualXml, string $message = '' )
$expectedFile string
$actualXml string
$message string
    public static function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '')
    {
        $expected = PHPUnit_Util_XML::loadFile($expectedFile);
        $actual = PHPUnit_Util_XML::load($actualXml);
        static::assertEquals($expected, $actual, $message);
    }

Usage Example

 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());
 }
All Usage Examples Of PHPUnit_Framework_Assert::assertXmlStringEqualsXmlFile
PHPUnit_Framework_Assert