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