wiki.techinc.nl/tests/phpunit/includes/page/WikiPagePreMcrDbTest.php
daniel 32e9266d8d Introduce per-schema unit tests for revision storage.
This introduces traits for testing different schema variations.
These are not very useful in this patch, but make it much easier
to add tests for MCR schema migration in subsequent patches.

The code in this patch was previously part of If259b1e1c49ceaa4.

Change-Id: I239572f75bebbc9c731a3e3860c4eff179dc15e4
2018-06-07 13:31:16 +00:00

51 lines
1 KiB
PHP

<?php
use MediaWiki\Tests\Storage\PreMcrSchemaOverride;
/**
* Tests WikiPage against the pre-MCR DB schema.
*
* @covers WikiPage
*
* @group WikiPage
* @group Storage
* @group ContentHandler
* @group Database
* @group medium
*/
class WikiPagePreMcrDbTest extends WikiPageDbTestBase {
use PreMcrSchemaOverride;
protected function getContentHandlerUseDB() {
return true;
}
/**
* @covers WikiPage::getContentModel
*/
public function testGetContentModel() {
$page = $this->createPage(
__METHOD__,
"some text",
CONTENT_MODEL_JAVASCRIPT
);
$page = new WikiPage( $page->getTitle() );
$this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $page->getContentModel() );
}
/**
* @covers WikiPage::getContentHandler
*/
public function testGetContentHandler() {
$page = $this->createPage(
__METHOD__,
"some text",
CONTENT_MODEL_JAVASCRIPT
);
$page = new WikiPage( $page->getTitle() );
$this->assertEquals( JavaScriptContentHandler::class, get_class( $page->getContentHandler() ) );
}
}