public function OutputRulesTest::testAttrs in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/masterminds/html5/test/HTML5/Serializer/OutputRulesTest.php \Masterminds\HTML5\Tests\Serializer\OutputRulesTest::testAttrs()
File
- vendor/
masterminds/ html5/ test/ HTML5/ Serializer/ OutputRulesTest.php, line 495
Class
Namespace
Masterminds\HTML5\Tests\SerializerCode
public function testAttrs() {
$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('attrs');
$m
->invoke($r, $list
->item(0));
$content = stream_get_contents($stream, -1, 0);
$this
->assertEquals(' id="foo" class="bar baz"', $content);
}