wiki.techinc.nl/tests/phpunit/includes/RevisionMcrDbTest.php
daniel 452c71663b Consolidate tests for getQueryInfo() and related methods.
This consolidates tests for getQueryInfo, getArchiveQueryInfo,
getSlotQueryInfo, and similar methods that help application logic
be compatible with different migration stages of different aspects
of the revision storage schema.

Bug: T198561
Change-Id: I8e4ae69d7e00721a0af125afaf9a708f7fe99b0a
2018-09-10 18:16:46 +00:00

49 lines
985 B
PHP

<?php
use MediaWiki\Storage\MutableRevisionRecord;
use MediaWiki\Storage\SlotRecord;
use MediaWiki\Tests\Storage\McrSchemaOverride;
/**
* Tests Revision against the MCR DB schema after schema migration.
*
* @covers Revision
*
* @group Revision
* @group Storage
* @group ContentHandler
* @group Database
* @group medium
*/
class RevisionMcrDbTest extends RevisionDbTestBase {
use McrSchemaOverride;
public function setUp() {
parent::setUp();
}
protected function getContentHandlerUseDB() {
return true;
}
public function provideGetTextId() {
yield [ [], null ];
$slot = new SlotRecord( (object)[
'slot_revision_id' => 42,
'slot_content_id' => 1,
'content_address' => 'tt:789',
'model_name' => CONTENT_MODEL_WIKITEXT,
'role_name' => 'main',
'slot_origin' => 1,
], new WikitextContent( 'Test' ) );
$rec = new MutableRevisionRecord( $this->getMockTitle() );
$rec->setId( 42 );
$rec->setSlot( $slot );
yield [ $rec, 789 ];
}
}