MediaWiki REL1_33
PageArchiveMcrTest.php
Go to the documentation of this file.
1<?php
4
16
17 use McrSchemaOverride;
18
22 public function testListRevisions_slots() {
23 $revisions = $this->archivedPage->listRevisions();
24
25 $revisionStore = MediaWikiServices::getInstance()->getInstance()->getRevisionStore();
26 $slotsQuery = $revisionStore->getSlotsQueryInfo( [ 'content' ] );
27
28 foreach ( $revisions as $row ) {
29 $this->assertSelect(
30 $slotsQuery['tables'],
31 'count(*)',
32 [ 'slot_revision_id' => $row->ar_rev_id ],
33 [ [ 1 ] ],
34 [],
35 $slotsQuery['joins']
36 );
37 }
38 }
39
40 protected function getExpectedArchiveRows() {
41 return [
42 [
43 'ar_minor_edit' => '0',
44 'ar_user' => null,
45 'ar_user_text' => $this->ipEditor,
46 'ar_actor' => (string)User::newFromName( $this->ipEditor, false )->getActorId( $this->db ),
47 'ar_len' => '11',
48 'ar_deleted' => '0',
49 'ar_rev_id' => strval( $this->ipRev->getId() ),
50 'ar_timestamp' => $this->db->timestamp( $this->ipRev->getTimestamp() ),
51 'ar_sha1' => '0qdrpxl537ivfnx4gcpnzz0285yxryy',
52 'ar_page_id' => strval( $this->ipRev->getPageId() ),
53 'ar_comment_text' => 'just a test',
54 'ar_comment_data' => null,
55 'ar_comment_cid' => '2',
56 'ts_tags' => null,
57 'ar_id' => '2',
58 'ar_namespace' => '0',
59 'ar_title' => 'PageArchiveTest_thePage',
60 'ar_parent_id' => strval( $this->ipRev->getParentId() ),
61 ],
62 [
63 'ar_minor_edit' => '0',
64 'ar_user' => (string)$this->getTestUser()->getUser()->getId(),
65 'ar_user_text' => $this->getTestUser()->getUser()->getName(),
66 'ar_actor' => (string)$this->getTestUser()->getUser()->getActorId(),
67 'ar_len' => '7',
68 'ar_deleted' => '0',
69 'ar_rev_id' => strval( $this->firstRev->getId() ),
70 'ar_timestamp' => $this->db->timestamp( $this->firstRev->getTimestamp() ),
71 'ar_sha1' => 'pr0s8e18148pxhgjfa0gjrvpy8fiyxc',
72 'ar_page_id' => strval( $this->firstRev->getPageId() ),
73 'ar_comment_text' => 'testing',
74 'ar_comment_data' => null,
75 'ar_comment_cid' => '1',
76 'ts_tags' => null,
77 'ar_id' => '1',
78 'ar_namespace' => '0',
79 'ar_title' => 'PageArchiveTest_thePage',
80 'ar_parent_id' => '0',
81 ],
82 ];
83 }
84
85}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
static getTestUser( $groups=[])
Convenience method for getting an immutable test user.
assertSelect( $table, $fields, $condition, array $expectedRows, array $options=[], array $join_conds=[])
Asserts that the given database query yields the rows given by $expectedRows.
MediaWikiServices is the service locator for the application scope of MediaWiki.
Test class for page archiving, using the new MCR schema.
testListRevisions_slots()
PageArchive::listRevisions.
Base class for tests of PageArchive against different database schemas.
$ipEditor
A logged out user who edited the page before it was archived.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition User.php:585
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
Definition hooks.txt:181