File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments