You are here

public function OutputRulesTest::testDocument in Zircon Profile 8

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

File

vendor/masterminds/html5/test/HTML5/Serializer/OutputRulesTest.php, line 66

Class

OutputRulesTest

Namespace

Masterminds\HTML5\Tests\Serializer

Code

public function testDocument() {
  $dom = $this->html5
    ->loadHTML('<!doctype html><html lang="en"><body>foo</body></html>');
  $stream = fopen('php://temp', 'w');
  $r = new OutputRules($stream, $this->html5
    ->getOptions());
  $t = new Traverser($dom, $stream, $r, $this->html5
    ->getOptions());
  $r
    ->document($dom);
  $expected = '<!DOCTYPE html>' . PHP_EOL . '<html lang="en"><body>foo</body></html>' . PHP_EOL;
  $this
    ->assertEquals($expected, stream_get_contents($stream, -1, 0));
}