tests: Fix wrong $rootNode in some tests using CommentParser::getComments()

Rather than the <body> node, we were passing <body>'s first child.
Current implementation of CommentParser::getComments() doesn't fail
the tests in spite of this because the XPath query incorrectly returns
results relative to the document's real root node, but these tests
would start failing after I2441f33e6e7bad753ac830d277e6a2e81ee8c93d.

Follow-up to 3e6ab2c4d2.

Change-Id: Ic26e0a1ee4443987e215c5f26ef1f084ccd0b40b
This commit is contained in:
Bartosz Dziewoński 2020-07-15 18:21:23 +02:00
parent 01ce5afaa9
commit 08b467bf9f
2 changed files with 3 additions and 3 deletions

View file

@ -28,7 +28,7 @@ class CommentModifierTest extends CommentTestCase {
$this->setupEnv( $config, $data );
$doc = self::createDocument( $dom );
$container = $doc->getElementsByTagName( 'body' )->item( 0 )->firstChild;
$container = $doc->getElementsByTagName( 'body' )->item( 0 );
$parser = self::createParser( $data );
$comments = $parser->getComments( $container );
@ -69,7 +69,7 @@ class CommentModifierTest extends CommentTestCase {
$this->setupEnv( $config, $data );
$doc = self::createDocument( $dom );
$container = $doc->getElementsByTagName( 'body' )->item( 0 )->firstChild;
$container = $doc->getElementsByTagName( 'body' )->item( 0 );
$parser = self::createParser( $data );
$comments = $parser->getComments( $container );

View file

@ -286,7 +286,7 @@ class CommentParserTest extends CommentTestCase {
$parser = self::createParser( $data );
$doc = self::createDocument( $dom );
$container = $doc->getElementsByTagName( 'body' )->item( 0 )->firstChild;
$container = $doc->getElementsByTagName( 'body' )->item( 0 );
CommentUtils::unwrapParsoidSections( $container );