3 use MediaWiki\MediaWikiServices
;
4 use MediaWiki\Tests\Revision\McrSchemaOverride
;
7 * Test class for page archiving, using the new MCR schema.
9 * @group ContentHandler
11 * ^--- important, causes temporary tables to be used instead of the real database
14 * ^--- important, causes tests not to fail with timeout
16 class PageArchiveMcrTest
extends PageArchiveTestBase
{
18 use McrSchemaOverride
;
21 * @covers PageArchive::listRevisions
23 public function testListRevisions_slots() {
24 $revisions = $this->archivedPage
->listRevisions();
26 $revisionStore = MediaWikiServices
::getInstance()->getInstance()->getRevisionStore();
27 $slotsQuery = $revisionStore->getSlotsQueryInfo( [ 'content' ] );
29 foreach ( $revisions as $row ) {
31 $slotsQuery['tables'],
33 [ 'slot_revision_id' => $row->ar_rev_id
],
41 protected function getExpectedArchiveRows() {
44 'ar_minor_edit' => '0',
46 'ar_user_text' => $this->ipEditor
,
47 'ar_actor' => (string)User
::newFromName( $this->ipEditor
, false )->getActorId( $this->db
),
50 'ar_rev_id' => strval( $this->ipRev
->getId() ),
51 'ar_timestamp' => $this->db
->timestamp( $this->ipRev
->getTimestamp() ),
52 'ar_sha1' => '0qdrpxl537ivfnx4gcpnzz0285yxryy',
53 'ar_page_id' => strval( $this->ipRev
->getPageId() ),
54 'ar_comment_text' => 'just a test',
55 'ar_comment_data' => null,
56 'ar_comment_cid' => '2',
59 'ar_namespace' => '0',
60 'ar_title' => 'PageArchiveTest_thePage',
61 'ar_parent_id' => strval( $this->ipRev
->getParentId() ),
64 'ar_minor_edit' => '0',
65 'ar_user' => (string)$this->getTestUser()->getUser()->getId(),
66 'ar_user_text' => $this->getTestUser()->getUser()->getName(),
67 'ar_actor' => (string)$this->getTestUser()->getUser()->getActorId(),
70 'ar_rev_id' => strval( $this->firstRev
->getId() ),
71 'ar_timestamp' => $this->db
->timestamp( $this->firstRev
->getTimestamp() ),
72 'ar_sha1' => 'pr0s8e18148pxhgjfa0gjrvpy8fiyxc',
73 'ar_page_id' => strval( $this->firstRev
->getPageId() ),
74 'ar_comment_text' => 'testing',
75 'ar_comment_data' => null,
76 'ar_comment_cid' => '1',
79 'ar_namespace' => '0',
80 'ar_title' => 'PageArchiveTest_thePage',
81 'ar_parent_id' => '0',