You are here

public function TraverserTest::testProcessorInstruction in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php \Masterminds\HTML5\Tests\Serializer\TraverserTest::testProcessorInstruction()

File

vendor/masterminds/html5/test/HTML5/Serializer/TraverserTest.php, line 90

Class

TraverserTest

Namespace

Masterminds\HTML5\Tests\Serializer

Code

public function testProcessorInstruction() {
  $html = '<?foo bar ?>';
  $input = new \Masterminds\HTML5\Parser\StringInputStream($html);
  $dom = $this->html5
    ->parseFragment($input);
  $this
    ->assertInstanceOf('\\DOMDocumentFragment', $dom);
  $stream = fopen('php://temp', 'w');
  $r = new OutputRules($stream, $this->html5
    ->getOptions());
  $t = new Traverser($dom, $stream, $r, $this->html5
    ->getOptions());
  $out = $t
    ->walk();
  $this
    ->assertEquals($html, stream_get_contents($stream, -1, 0));
}