You are here

public function DOMTreeBuilderTest::testDocumentWithATargetDocument in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php \Masterminds\HTML5\Tests\Parser\DOMTreeBuilderTest::testDocumentWithATargetDocument()

File

vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php, line 92
Test the Tree Builder.

Class

DOMTreeBuilderTest
These tests are functional, not necessarily unit tests.

Namespace

Masterminds\HTML5\Tests\Parser

Code

public function testDocumentWithATargetDocument() {
  $targetDom = new \DOMDocument();
  $html = "<!DOCTYPE html><html></html>";
  $doc = $this
    ->parse($html, array(
    'target_document' => $targetDom,
  ));
  $this
    ->assertInstanceOf('\\DOMDocument', $doc);
  $this
    ->assertSame($doc, $targetDom);
  $this
    ->assertEquals('html', $doc->documentElement->tagName);
}