[ 'parsoid' => [ 'rah' => 'rah' ] ], ] ) ); // Note that we use the 'native' getElementById, not // DOMCompat::getElementById, in order to test T232390 $el = $doc->getElementById( 'mw-pagebundle' ); $this->assertNotEquals( $el, null ); $this->assertEquals( $el->tagName, 'script' ); } /** * @covers ::storeInPageBundle */ public function testStoreInPageBundle() { $env = new MockEnv( [] ); $doc = DOMUtils::parseHTML( "

Hello, world

" ); $doc->bag = new DataBag(); // see Env::createDocument $p = DOMCompat::querySelector( $doc, 'p' ); DOMDataUtils::storeInPageBundle( $p, $env, PHPUtils::arrayToObject( [ 'parsoid' => [ 'go' => 'team' ], 'mw' => [ 'test' => 'me' ], ] ), DOMDataUtils::usedIdIndex( $p ) ); $id = $p->getAttribute( 'id' ); $this->assertNotEquals( $id, null ); // Use the 'native' getElementById, not DOMCompat::getElementById, // in order to test T232390. $el = $doc->getElementById( $id ); $this->assertEquals( $el, $p ); } }