Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git] / tests / phpunit / includes / page / PageArchivePreMcrTest.php
1 <?php
2
3 use MediaWiki\MediaWikiServices;
4 use MediaWiki\Revision\SlotRecord;
5 use MediaWiki\Storage\SqlBlobStore;
6 use MediaWiki\Tests\Revision\PreMcrSchemaOverride;
7
8 /**
9 * Test class for page archiving, using the pre-MCR schema.
10 *
11 * @group ContentHandler
12 * @group Database
13 * ^--- important, causes temporary tables to be used instead of the real database
14 *
15 * @group medium
16 * ^--- important, causes tests not to fail with timeout
17 */
18 class PageArchivePreMcrTest extends PageArchiveTestBase {
19
20 use PreMcrSchemaOverride;
21
22 protected function getExpectedArchiveRows() {
23 /** @var SqlBlobStore $blobStore */
24 $blobStore = MediaWikiServices::getInstance()->getBlobStore();
25
26 return [
27 [
28 'ar_minor_edit' => '0',
29 'ar_user' => null,
30 'ar_user_text' => $this->ipEditor,
31 'ar_actor' => (string)User::newFromName( $this->ipEditor, false )->getActorId( $this->db ),
32 'ar_len' => '11',
33 'ar_deleted' => '0',
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,
43 'ts_tags' => null,
44 'ar_id' => '2',
45 'ar_namespace' => '0',
46 'ar_title' => 'PageArchiveTest_thePage',
47 'ar_text_id' => (string)$blobStore->getTextIdFromAddress(
48 $this->ipRev->getSlot( SlotRecord::MAIN )->getAddress()
49 ),
50 'ar_parent_id' => strval( $this->ipRev->getParentId() ),
51 ],
52 [
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(),
57 'ar_len' => '7',
58 'ar_deleted' => '0',
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,
68 'ts_tags' => null,
69 'ar_id' => '1',
70 'ar_namespace' => '0',
71 'ar_title' => 'PageArchiveTest_thePage',
72 'ar_text_id' => (string)$blobStore->getTextIdFromAddress(
73 $this->firstRev->getSlot( SlotRecord::MAIN )->getAddress()
74 ),
75 'ar_parent_id' => '0',
76 ],
77 ];
78 }
79
80 }