2022-05-16 16:56:20 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Tests\Unit\Edit;
|
|
|
|
|
|
|
|
|
|
use HashBagOStuff;
|
|
|
|
|
use MediaWiki\Edit\SimpleParsoidOutputStash;
|
|
|
|
|
use MediaWiki\Parser\Parsoid\ParsoidRenderID;
|
|
|
|
|
use Wikimedia\Parsoid\Core\PageBundle;
|
|
|
|
|
|
|
|
|
|
/** @covers \MediaWiki\Edit\SimpleParsoidOutputStash */
|
|
|
|
|
class SimpleParsoidOutputStashTest extends \MediaWikiUnitTestCase {
|
|
|
|
|
|
|
|
|
|
public function testSetAndGet() {
|
2022-06-02 18:15:36 +00:00
|
|
|
$stash = new SimpleParsoidOutputStash( new HashBagOStuff(), 12 );
|
2022-05-16 16:56:20 +00:00
|
|
|
|
|
|
|
|
$key = new ParsoidRenderID( 7, 'acme' );
|
|
|
|
|
$pageBundle = new PageBundle( 'Hello World' );
|
|
|
|
|
|
|
|
|
|
$stash->set( $key, $pageBundle );
|
|
|
|
|
$this->assertEquals( $pageBundle, $stash->get( $key ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|