���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/rickpfrv/wiki.craftaro.com/vendor/wikimedia/parsoid/tests/phpunit/Parsoid/Utils/DOMDataUtilsTest.php
���ѧ٧ѧ�
<?php namespace Test\Parsoid\Utils; use Wikimedia\Parsoid\Mocks\MockEnv; use Wikimedia\Parsoid\NodeData\DataBag; use Wikimedia\Parsoid\Utils\DOMCompat; use Wikimedia\Parsoid\Utils\DOMDataUtils; use Wikimedia\Parsoid\Utils\DOMUtils; use Wikimedia\Parsoid\Utils\PHPUtils; /** * @coversDefaultClass \Wikimedia\Parsoid\Utils\DOMDataUtils */ class DOMDataUtilsTest extends \PHPUnit\Framework\TestCase { /** * @covers ::injectPageBundle */ public function testInjectPageBundle() { $doc = DOMUtils::parseHTML( "Hello, world" ); DOMDataUtils::injectPageBundle( $doc, PHPUtils::arrayToObject( [ 'node-id' => [ '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( DOMCompat::nodeName( $el ), 'script' ); } /** * @covers ::storeInPageBundle */ public function testStoreInPageBundle() { $env = new MockEnv( [] ); $doc = DOMUtils::parseHTML( "<p>Hello, world</p>" ); $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 ); // Use the 'native' getElementById, not DOMCompat::getElementById, // in order to test T232390. $el = $doc->getElementById( $id ); $this->assertEquals( $p, $el ); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0.09 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�