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