Skip to content

Commit

Permalink
split test
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Jan 11, 2023
1 parent 4d14e8c commit bf96de0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/HTML5/Parser/DOMTreeBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,17 @@ public function testText()
$data = $wrapper->childNodes->item(0);
$this->assertEquals(XML_TEXT_NODE, $data->nodeType);
$this->assertEquals('test', $data->data);
}

public function testTextBeforeHeadNotAllowed()
{
// The DomTreeBuilder has special handling for text when in before head mode.
$html = '<!DOCTYPE html><html>
Foo<head></head><body></body></html>';
$html = '<!DOCTYPE html><html>Foo<head></head><body></body></html>';
$doc = $this->parse($html);
$this->assertEquals('Line 0, Col 0: Unexpected text. Ignoring: Foo', $this->errors[0]);
$this->assertEquals('Line 0, Col 0: Unexpected head tag outside of head context.', $this->errors[0]);
$headElement = $doc->documentElement->firstChild;
$this->assertEquals('head', $headElement->tagName);
$this->assertXmlStringEqualsXmlString($doc, '<html xmlns="http://www.w3.org/1999/xhtml"><head/><body>Foo<head/><body/></body></html>');
}

public function testParseErrors()
Expand Down

0 comments on commit bf96de0

Please sign in to comment.