MediaWiki REL1_32
WikiPageNoContentModelDbTest.php
Go to the documentation of this file.
1<?php
2use MediaWiki\Tests\Revision\PreMcrSchemaOverride;
3
16
17 use PreMcrSchemaOverride;
18
19 protected function getContentHandlerUseDB() {
20 return false;
21 }
22
23 public function testGetDeletionUpdates() {
24 $mainContent1 = new WikitextContent( '' );
25
26 $title = Title::makeTitle( $this->getDefaultWikitextNS(), __METHOD__ );
27 $page = new WikiPage( $title );
28 $page = $this->createPage(
29 $page,
30 [ 'main' => $mainContent1 ]
31 );
32
33 $dataUpdates = $page->getDeletionUpdates( $page->getRevisionRecord() );
34 $this->assertNotEmpty( $dataUpdates );
35
36 $updateNames = array_map( function ( $du ) {
37 return isset( $du->_name ) ? $du->_name : get_class( $du );
38 }, $dataUpdates );
39
40 $this->assertContains( LinksDeletionUpdate::class, $updateNames );
41 }
42
43}
getDefaultWikitextNS()
Returns the ID of a namespace that defaults to Wikitext.
createPage( $page, $content, $model=null, $user=null)
Tests WikiPage against the pre-MCR, pre ContentHandler DB schema.
Class representing a MediaWiki article and history.
Definition WikiPage.php:44
Content object for wiki text pages.