2 namespace MediaWiki\Tests\Storage
;
4 use MediaWiki\Storage\RevisionRecord
;
5 use MediaWiki\Storage\SlotRecord
;
8 * Tests RevisionStore against the intermediate MCR DB schema for use during schema migration.
10 * @covers \MediaWiki\Storage\RevisionStore
12 * @group RevisionStore
17 class McrWriteBothRevisionStoreDbTest
extends RevisionStoreDbTestBase
{
19 use McrWriteBothSchemaOverride
;
21 protected function assertRevisionExistsInDatabase( RevisionRecord
$rev ) {
22 parent
::assertRevisionExistsInDatabase( $rev );
25 'slots', [ 'count(*)' ], [ 'slot_revision_id' => $rev->getId() ], [ [ '1' ] ]
30 [ 'content_address' => $rev->getSlot( 'main' )->getAddress() ],
36 * @param SlotRecord $a
37 * @param SlotRecord $b
39 protected function assertSameSlotContent( SlotRecord
$a, SlotRecord
$b ) {
40 parent
::assertSameSlotContent( $a, $b );
42 // Assert that the same content ID has been used
43 if ( $a->hasContentId() && $b->hasContentId() ) {
44 $this->assertSame( $a->getContentId(), $b->getContentId() );
48 public function provideGetArchiveQueryInfo() {
51 'tables' => [ 'archive' ],
52 'fields' => array_merge(
53 $this->getDefaultArchiveFields(),
55 'ar_comment_text' => 'ar_comment',
56 'ar_comment_data' => 'NULL',
57 'ar_comment_cid' => 'NULL',
58 'ar_user_text' => 'ar_user_text',
59 'ar_user' => 'ar_user',
70 public function provideGetQueryInfo() {
74 'tables' => [ 'revision' ],
75 'fields' => array_merge(
76 $this->getDefaultQueryFields(),
77 $this->getCommentQueryFields(),
78 $this->getActorQueryFields(),
79 $this->getContentHandlerQueryFields()
85 [ 'page', 'user', 'text' ],
87 'tables' => [ 'revision', 'page', 'user', 'text' ],
88 'fields' => array_merge(
89 $this->getDefaultQueryFields(),
90 $this->getCommentQueryFields(),
91 $this->getActorQueryFields(),
92 $this->getContentHandlerQueryFields(),
106 'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
107 'user' => [ 'LEFT JOIN', [ 'rev_user != 0', 'user_id = rev_user' ] ],
108 'text' => [ 'INNER JOIN', [ 'rev_text_id=old_id' ] ],