2 use MediaWiki\MediaWikiServices
;
3 use MediaWiki\Tests\Storage\McrSchemaOverride
;
6 * Test class for page archiving, using the new MCR schema.
8 * @group ContentHandler
10 * ^--- important, causes temporary tables to be used instead of the real database
13 * ^--- important, causes tests not to fail with timeout
15 class PageArchiveMcrTest
extends PageArchiveTestBase
{
17 use McrSchemaOverride
;
20 * @covers PageArchive::listRevisions
22 public function testListRevisions_slots() {
23 $revisions = $this->archivedPage
->listRevisions();
25 $revisionStore = MediaWikiServices
::getInstance()->getInstance()->getRevisionStore();
26 $slotsQuery = $revisionStore->getSlotsQueryInfo( [ 'content' ] );
28 foreach ( $revisions as $row ) {
30 $slotsQuery['tables'],
32 [ 'slot_revision_id' => $row->ar_rev_id
],
40 protected function getExpectedArchiveRows() {
43 'ar_minor_edit' => '0',
45 'ar_user_text' => $this->ipEditor
,
49 'ar_rev_id' => strval( $this->ipRev
->getId() ),
50 'ar_timestamp' => $this->db
->timestamp( $this->ipRev
->getTimestamp() ),
51 'ar_sha1' => '0qdrpxl537ivfnx4gcpnzz0285yxryy',
52 'ar_page_id' => strval( $this->ipRev
->getPageId() ),
53 'ar_comment_text' => 'just a test',
54 'ar_comment_data' => null,
55 'ar_comment_cid' => null,
58 'ar_namespace' => '0',
59 'ar_title' => 'PageArchiveTest_thePage',
60 'ar_parent_id' => strval( $this->ipRev
->getParentId() ),
63 'ar_minor_edit' => '0',
64 'ar_user' => (string)$this->getTestUser()->getUser()->getId(),
65 'ar_user_text' => $this->getTestUser()->getUser()->getName(),
69 'ar_rev_id' => strval( $this->firstRev
->getId() ),
70 'ar_timestamp' => $this->db
->timestamp( $this->firstRev
->getTimestamp() ),
71 'ar_sha1' => 'pr0s8e18148pxhgjfa0gjrvpy8fiyxc',
72 'ar_page_id' => strval( $this->firstRev
->getPageId() ),
73 'ar_comment_text' => 'testing',
74 'ar_comment_data' => null,
75 'ar_comment_cid' => null,
78 'ar_namespace' => '0',
79 'ar_title' => 'PageArchiveTest_thePage',
80 'ar_parent_id' => '0',