Skip to content

Commit bf96de0

Browse files
committed
split test
1 parent 4d14e8c commit bf96de0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/HTML5/Parser/DOMTreeBuilderTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,17 @@ public function testText()
457457
$data = $wrapper->childNodes->item(0);
458458
$this->assertEquals(XML_TEXT_NODE, $data->nodeType);
459459
$this->assertEquals('test', $data->data);
460+
}
460461

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

470473
public function testParseErrors()

0 commit comments

Comments
 (0)