3 use MediaWiki\MediaWikiServices
;
4 use MediaWiki\Tests\Revision\McrReadNewSchemaOverride
;
7 * Tests WikiPage against the intermediate MCR DB schema for use during schema migration.
13 * @group ContentHandler
17 class WikiPageMcrReadNewDbTest
extends WikiPageDbTestBase
{
19 use McrReadNewSchemaOverride
;
21 protected function getContentHandlerUseDB() {
25 public function testGetDeletionUpdates() {
26 $m1 = $this->defineMockContentModelForUpdateTesting( 'M1' );
27 $a1 = $this->defineMockContentModelForUpdateTesting( 'A1' );
29 MediaWikiServices
::getInstance()->getSlotRoleRegistry()->defineRoleWithModel(
34 $mainContent1 = $this->createMockContent( $m1, 'main 1' );
35 $auxContent1 = $this->createMockContent( $a1, 'aux 1' );
37 $page = new WikiPage( Title
::newFromText( __METHOD__
) );
38 $page = $this->createPage(
40 [ 'main' => $mainContent1, 'aux' => $auxContent1 ]
43 $dataUpdates = $page->getDeletionUpdates( $page->getRevisionRecord() );
44 $this->assertNotEmpty( $dataUpdates );
46 $updateNames = array_map( function ( $du ) {
47 return isset( $du->_name
) ?
$du->_name
: get_class( $du );
50 $this->assertContains( LinksDeletionUpdate
::class, $updateNames );
51 $this->assertContains( 'M1 deletion update', $updateNames );
52 $this->assertContains( 'A1 deletion update', $updateNames );