3 use MediaWiki\MediaWikiServices
;
4 use MediaWiki\Revision\SlotRecord
;
5 use MediaWiki\Storage\SqlBlobStore
;
6 use MediaWiki\Tests\Revision\PreMcrSchemaOverride
;
9 * Test class for page archiving, using the pre-MCR schema.
11 * @group ContentHandler
13 * ^--- important, causes temporary tables to be used instead of the real database
16 * ^--- important, causes tests not to fail with timeout
18 class PageArchivePreMcrTest
extends PageArchiveTestBase
{
20 use PreMcrSchemaOverride
;
22 protected function getExpectedArchiveRows() {
23 /** @var SqlBlobStore $blobStore */
24 $blobStore = MediaWikiServices
::getInstance()->getBlobStore();
28 'ar_minor_edit' => '0',
30 'ar_user_text' => $this->ipEditor
,
31 'ar_actor' => (string)User
::newFromName( $this->ipEditor
, false )->getActorId( $this->db
),
34 'ar_rev_id' => strval( $this->ipRev
->getId() ),
35 'ar_timestamp' => $this->db
->timestamp( $this->ipRev
->getTimestamp() ),
36 'ar_sha1' => '0qdrpxl537ivfnx4gcpnzz0285yxryy',
37 'ar_page_id' => strval( $this->ipRev
->getPageId() ),
38 'ar_comment_text' => 'just a test',
39 'ar_comment_data' => null,
40 'ar_comment_cid' => '2',
41 'ar_content_format' => null,
42 'ar_content_model' => null,
45 'ar_namespace' => '0',
46 'ar_title' => 'PageArchiveTest_thePage',
47 'ar_text_id' => (string)$blobStore->getTextIdFromAddress(
48 $this->ipRev
->getSlot( SlotRecord
::MAIN
)->getAddress()
50 'ar_parent_id' => strval( $this->ipRev
->getParentId() ),
53 'ar_minor_edit' => '0',
54 'ar_user' => (string)$this->getTestUser()->getUser()->getId(),
55 'ar_user_text' => $this->getTestUser()->getUser()->getName(),
56 'ar_actor' => (string)$this->getTestUser()->getUser()->getActorId(),
59 'ar_rev_id' => strval( $this->firstRev
->getId() ),
60 'ar_timestamp' => $this->db
->timestamp( $this->firstRev
->getTimestamp() ),
61 'ar_sha1' => 'pr0s8e18148pxhgjfa0gjrvpy8fiyxc',
62 'ar_page_id' => strval( $this->firstRev
->getPageId() ),
63 'ar_comment_text' => 'testing',
64 'ar_comment_data' => null,
65 'ar_comment_cid' => '1',
66 'ar_content_format' => null,
67 'ar_content_model' => null,
70 'ar_namespace' => '0',
71 'ar_title' => 'PageArchiveTest_thePage',
72 'ar_text_id' => (string)$blobStore->getTextIdFromAddress(
73 $this->firstRev
->getSlot( SlotRecord
::MAIN
)->getAddress()
75 'ar_parent_id' => '0',