MediaWiki REL1_33
WikiPageMcrReadNewDbTest.php
Go to the documentation of this file.
1<?php
2
5
18
19 use McrReadNewSchemaOverride;
20
21 protected function getContentHandlerUseDB() {
22 return true;
23 }
24
25 public function testGetDeletionUpdates() {
26 $m1 = $this->defineMockContentModelForUpdateTesting( 'M1' );
27 $a1 = $this->defineMockContentModelForUpdateTesting( 'A1' );
28
29 MediaWikiServices::getInstance()->getSlotRoleRegistry()->defineRoleWithModel(
30 'aux',
31 $a1->getModelID()
32 );
33
34 $mainContent1 = $this->createMockContent( $m1, 'main 1' );
35 $auxContent1 = $this->createMockContent( $a1, 'aux 1' );
36
37 $page = new WikiPage( Title::newFromText( __METHOD__ ) );
38 $page = $this->createPage(
39 $page,
40 [ 'main' => $mainContent1, 'aux' => $auxContent1 ]
41 );
42
43 $dataUpdates = $page->getDeletionUpdates( $page->getRevisionRecord() );
44 $this->assertNotEmpty( $dataUpdates );
45
46 $updateNames = array_map( function ( $du ) {
47 return isset( $du->_name ) ? $du->_name : get_class( $du );
48 }, $dataUpdates );
49
50 $this->assertContains( LinksDeletionUpdate::class, $updateNames );
51 $this->assertContains( 'M1 deletion update', $updateNames );
52 $this->assertContains( 'A1 deletion update', $updateNames );
53 }
54
55}
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
MediaWikiServices is the service locator for the application scope of MediaWiki.
createPage( $page, $content, $model=null, $user=null)
defineMockContentModelForUpdateTesting( $name)
createMockContent(ContentHandler $handler, $text)
Tests WikiPage against the intermediate MCR DB schema for use during schema migration.
Class representing a MediaWiki article and history.
Definition WikiPage.php:45