You are here

public function OutputRulesTest::testOpenTag in Zircon Profile 8.0

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

File

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

Class

OutputRulesTest

Namespace

Masterminds\HTML5\Tests\Serializer

Code

public function testOpenTag() {
  $dom = $this->html5
    ->loadHTML('<!doctype html>
    <html lang="en">
      <body>
        <div id="foo" class="bar baz">foo bar baz</div>
      </body>
    </html>');
  $stream = fopen('php://temp', 'w');
  $r = new OutputRules($stream, $this->html5
    ->getOptions());
  $t = new Traverser($dom, $stream, $r, $this->html5
    ->getOptions());
  $list = $dom
    ->getElementsByTagName('div');
  $m = $this
    ->getProtectedMethod('openTag');
  $m
    ->invoke($r, $list
    ->item(0));
  $this
    ->assertEquals('<div id="foo" class="bar baz">', stream_get_contents($stream, -1, 0));
}