You are here

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

File

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

Class

OutputRulesTest

Namespace

Masterminds\HTML5\Tests\Serializer

Code

public function testDoctype() {
  $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());
  $m = $this
    ->getProtectedMethod('doctype');
  $m
    ->invoke($r, 'foo');
  $this
    ->assertEquals("<!DOCTYPE html>" . PHP_EOL, stream_get_contents($stream, -1, 0));
}