You are here

public function OutputRulesTest::testEmptyDocument 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::testEmptyDocument()

File

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

Class

OutputRulesTest

Namespace

Masterminds\HTML5\Tests\Serializer

Code

public function testEmptyDocument() {
  $dom = $this->html5
    ->loadHTML('');
  $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;
  $this
    ->assertEquals($expected, stream_get_contents($stream, -1, 0));
}