wiki.techinc.nl/tests/phpunit/unit/includes/edit/SimpleParsoidOutputStashTest.php
daniel 4dd7bd16b5 ParsoidOutputStash: make storage backend configurable.
This introduces the ParsoidOutputStash config setting, which defines the
storage backend and cache duration. The storage backend name refers to
an entry in the ObjectCache setting, and defaults to the main stash.

Bug: T267990
Bug: T309016
Change-Id: Ic67dc43ed9843810e4b180127f9a3bb7608f7608
2022-06-14 14:11:37 +01:00

23 lines
618 B
PHP

<?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() {
$stash = new SimpleParsoidOutputStash( new HashBagOStuff(), 12 );
$key = new ParsoidRenderID( 7, 'acme' );
$pageBundle = new PageBundle( 'Hello World' );
$stash->set( $key, $pageBundle );
$this->assertEquals( $pageBundle, $stash->get( $key ) );
}
}