示例#1
0
 /**
  * Compare two HTML fragments.
  */
 protected function assertEqualHtml(Example $expected, $actual, $message = '')
 {
     $from = ['/\\>[^\\S ]+/s', '/[^\\S ]+\\</s', '/(\\s)+/s', '/> </s', '/>\\s+\\[/s', '/\\]\\s+</s'];
     $to = ['>', '<', '\\1', '><', '>[', ']<'];
     $this->assertEquals($this->indentHtml(ConvertXMLToHtml::tidyHtml(preg_replace($from, $to, $expected))), $this->indentHtml(ConvertXMLToHtml::tidyHtml(preg_replace($from, $to, $actual))), $message . PHP_EOL . $expected->debugInformation());
 }
 /**
  * Compare two HTML fragments.
  */
 protected function assertEqualHtml($expected, $actual, $message = '')
 {
     $from = ['/\\>[^\\S ]+/s', '/[^\\S ]+\\</s', '/(\\s)+/s', '/> </s', '/>\\s+\\[/s', '/\\]\\s+</s'];
     $to = ['>', '<', '\\1', '><', '>[', ']<'];
     $this->assertEquals(ConvertXMLToHtml::tidyHtml(preg_replace($from, $to, $expected)), ConvertXMLToHtml::tidyHtml(preg_replace($from, $to, $actual)), $message);
 }