wiki.techinc.nl/tests/phpunit/includes/RevisionMcrReadNewDbTest.php
Aaron Schulz cb15755e92 Normalize use of "INNER JOIN" to "JOIN" in database queries
The ANSI SQL default join type is INNER and this might save
some line breaks here and there.

Change-Id: Ibd39976f46ca3f9b71190d3b60b76ca085787a00
2019-03-06 09:17:30 -08:00

59 lines
1.3 KiB
PHP

<?php
use MediaWiki\Revision\MutableRevisionRecord;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\Tests\Revision\McrReadNewSchemaOverride;
/**
* Tests Revision against the intermediate MCR DB schema for use during schema migration.
*
* @covers Revision
*
* @group Revision
* @group Storage
* @group ContentHandler
* @group Database
* @group medium
*/
class RevisionMcrReadNewDbTest extends RevisionDbTestBase {
use McrReadNewSchemaOverride;
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' => SlotRecord::MAIN,
'slot_origin' => 1,
], new WikitextContent( 'Test' ) );
$rec = new MutableRevisionRecord( $this->getMockTitle() );
$rec->setId( 42 );
$rec->setSlot( $slot );
yield [ $rec, 789 ];
}
public function provideGetRevisionText() {
yield 'no text table' => [
[]
];
yield 'force text table' => [
[],
[
'tables' => [ 'text' ],
'fields' => [ 'old_id', 'old_text', 'old_flags', 'rev_text_id' ],
'joins' => [ 'text' => [ 'JOIN', 'old_id=rev_text_id' ] ]
]
];
}
}