wiki.techinc.nl/tests/phpunit/includes/page/WikiPageNoContentModelDbTest.php
daniel 7960d5385f Introduce ContentHandler::getSecondaryDataUpdates.
This adds getSecondaryDataUpdates and getDeletionUpdates
to ContentHandler, and updates WikiPage and DerivedPageDataUpdates
to handle DataUpdates from all slots.

Bug: T194038
Bug: T194037
Change-Id: I75c96318f58a5cdda48484f7040ae41e6f42392a
2018-09-14 16:18:18 +02:00

43 lines
1,015 B
PHP

<?php
use MediaWiki\Tests\Storage\PreMcrSchemaOverride;
/**
* Tests WikiPage against the pre-MCR, pre ContentHandler DB schema.
*
* @covers WikiPage
*
* @group WikiPage
* @group Storage
* @group ContentHandler
* @group Database
* @group medium
*/
class WikiPageNoContentModelDbTest extends WikiPageDbTestBase {
use PreMcrSchemaOverride;
protected function getContentHandlerUseDB() {
return false;
}
public function testGetDeletionUpdates() {
$mainContent1 = new WikitextContent( '' );
$title = Title::makeTitle( $this->getDefaultWikitextNS(), __METHOD__ );
$page = new WikiPage( $title );
$page = $this->createPage(
$page,
[ 'main' => $mainContent1 ]
);
$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 );
}
}