features/bootstrap/FeatureContext.php
public function fileXmlShouldBeLike($path, PyStringNode $text)
    {
        $path = $this->workingDir . '/' . $path;
        Assert::assertFileExists($path);

        $fileContent = trim(file_get_contents($path));

        $fileContent = preg_replace('/time="(.*)"/', 'time="-IGNORE-VALUE-"', $fileContent);

        $dom = new DOMDocument();
        $dom->loadXML($text);
        $dom->formatOutput = true;

        Assert::assertEquals(trim($dom->saveXML(null, LIBXML_NOEMPTYTAG)), $fileContent);
    }
public function fileXmlShouldBeLike($path, PyStringNode $text)
    {
        $path = $this->workingDir . '/' . $path;
        Assert::assertFileExists($path);

        $fileContent = trim(file_get_contents($path));

        $fileContent = preg_replace('/time="(.*)"/', 'time="-IGNORE-VALUE-"', $fileContent);

        $dom = new DOMDocument();
        $dom->loadXML($text);
        $dom->formatOutput = true;

        Assert::assertEquals(trim($dom->saveXML(null, LIBXML_NOEMPTYTAG)), $fileContent);
    }
public function fileXmlShouldBeLike ( $ path , PyStringNode $ text ) { $ path = $ this -> workingDir . '/' . $ path ; Assert :: assertFileExists ( $ path ) ; $ fileContent = trim ( file_get_contents ( $ path ) ) ; $ fileContent = preg_replace ( '/time="(.*)"/' , 'time="-IGNORE-VALUE-"' , $ fileContent ) ; $ dom = new DOMDocument ( ) ; $ dom -> loadXML ( $ text ) ; $ dom -> formatOutput = true ; Assert :: assertEquals ( trim ( $ dom -> saveXML ( null , LIBXML_NOEMPTYTAG ) ) , $ fileContent ) ; }
Checks whether specified content and structure of the xml is correct without worrying about layout.

@Then /^"([^"]*)" file xml should be like:$/

@param string       $path file path
@param PyStringNode $text file content
Checks whether specified content and structure of the xml is correct without worrying about layout .