2 namespace MediaWiki\Tests\Storage
;
7 * Tests RevisionStore against the pre-MCR, pre-ContentHandler DB schema.
9 * @covers \MediaWiki\Storage\RevisionStore
11 * @group RevisionStore
16 class NoContentModelRevisionStoreDbTest
extends RevisionStoreDbTestBase
{
18 use PreMcrSchemaOverride
;
20 protected function getContentHandlerUseDB() {
24 protected function revisionToRow( Revision
$rev, $options = [ 'page', 'user', 'comment' ] ) {
25 $row = parent
::revisionToRow( $rev, $options );
27 $row->rev_text_id
= (string)$rev->getTextId();
32 public function provideGetArchiveQueryInfo() {
35 'tables' => [ 'archive' ],
36 'fields' => array_merge(
37 $this->getDefaultArchiveFields(),
39 'ar_comment_text' => 'ar_comment',
40 'ar_comment_data' => 'NULL',
41 'ar_comment_cid' => 'NULL',
42 'ar_user_text' => 'ar_user_text',
43 'ar_user' => 'ar_user',
52 public function provideGetQueryInfo() {
56 'tables' => [ 'revision' ],
57 'fields' => array_merge(
58 $this->getDefaultQueryFields(),
59 $this->getCommentQueryFields(),
60 $this->getActorQueryFields()
68 'tables' => [ 'revision', 'page' ],
69 'fields' => array_merge(
70 $this->getDefaultQueryFields(),
71 $this->getCommentQueryFields(),
72 $this->getActorQueryFields(),
83 'page' => [ 'INNER JOIN', [ 'page_id = rev_page' ] ],
90 'tables' => [ 'revision', 'user' ],
91 'fields' => array_merge(
92 $this->getDefaultQueryFields(),
93 $this->getCommentQueryFields(),
94 $this->getActorQueryFields(),
100 'user' => [ 'LEFT JOIN', [ 'rev_user != 0', 'user_id = rev_user' ] ],
107 'tables' => [ 'revision', 'text' ],
108 'fields' => array_merge(
109 $this->getDefaultQueryFields(),
110 $this->getCommentQueryFields(),
111 $this->getActorQueryFields(),
118 'text' => [ 'INNER JOIN', [ 'rev_text_id=old_id' ] ],
124 public function provideGetSlotsQueryInfo() {
125 $db = wfGetDB( DB_REPLICA
);
131 'slots' => 'revision',
133 'fields' => array_merge(
135 'slot_revision_id' => 'slots.rev_id',
136 'slot_content_id' => 'NULL',
137 'slot_origin' => 'slots.rev_id',
138 'role_name' => $db->addQuotes( SlotRecord
::MAIN
),
148 'slots' => 'revision',
150 'fields' => array_merge(
152 'slot_revision_id' => 'slots.rev_id',
153 'slot_content_id' => 'NULL',
154 'slot_origin' => 'slots.rev_id',
155 'role_name' => $db->addQuotes( SlotRecord
::MAIN
),
156 'content_size' => 'slots.rev_len',
157 'content_sha1' => 'slots.rev_sha1',
159 $db->buildConcat( [ $db->addQuotes( 'tt:' ), 'slots.rev_text_id' ] ),
160 'model_name' => 'NULL',
168 public function provideNewMutableRevisionFromArray() {
169 foreach ( parent
::provideNewMutableRevisionFromArray() as $case ) {
173 yield
'Basic array, with page & id' => [
178 'timestamp' => '20171017114835',
179 'user_text' => '111.0.1.2',
181 'minor_edit' => false,
185 'sha1' => 'rdqbbzs3pkhihgbs8qf2q9jsvheag5z',
186 'comment' => 'Goat Comment!',