wiki.techinc.nl/tests/phpunit/includes/page/WikiPageMcrReadNewDbTest.php
Brad Jorsch dff469a408 Re-namespace RevisionStore and RevisionRecord classes
During development a lot of classes were placed in MediaWiki\Storage\.
The precedent set would mean that every class relating to something
stored in a database table, plus all related value classes and such,
would go into that namespace.

Let's put them into MediaWiki\Revision\ instead. Then future classes
related to the 'page' table can go into MediaWiki\Page\, future classes
related to the 'user' table can go into MediaWiki\User\, and so on.

Note I didn't move DerivedPageDataUpdater, PageUpdateException,
PageUpdater, or RevisionSlotsUpdate in this patch. If these are kept
long-term, they probably belong in MediaWiki\Page\ or MediaWiki\Edit\
instead.

Bug: T204158
Change-Id: I16bea8927566a3c73c07e4f4afb3537e05aa04a5
2018-10-09 10:22:48 -04:00

48 lines
1.3 KiB
PHP

<?php
use MediaWiki\Tests\Revision\McrReadNewSchemaOverride;
/**
* Tests WikiPage against the intermediate MCR DB schema for use during schema migration.
*
* @covers WikiPage
*
* @group WikiPage
* @group Storage
* @group ContentHandler
* @group Database
* @group medium
*/
class WikiPageMcrReadNewDbTest extends WikiPageDbTestBase {
use McrReadNewSchemaOverride;
protected function getContentHandlerUseDB() {
return true;
}
public function testGetDeletionUpdates() {
$m1 = $this->defineMockContentModelForUpdateTesting( 'M1' );
$a1 = $this->defineMockContentModelForUpdateTesting( 'A1' );
$mainContent1 = $this->createMockContent( $m1, 'main 1' );
$auxContent1 = $this->createMockContent( $a1, 'aux 1' );
$page = new WikiPage( Title::newFromText( __METHOD__ ) );
$page = $this->createPage(
$page,
[ 'main' => $mainContent1, 'aux' => $auxContent1 ]
);
$dataUpdates = $page->getDeletionUpdates( $page->getRevisionRecord() );
$this->assertNotEmpty( $dataUpdates );
$updateNames = array_map( function ( $du ) {
return isset( $du->_name ) ? $du->_name : get_class( $du );
}, $dataUpdates );
$this->assertContains( LinksDeletionUpdate::class, $updateNames );
$this->assertContains( 'M1 deletion update', $updateNames );
$this->assertContains( 'A1 deletion update', $updateNames );
}
}