WikiPageNoContentModelDbTest.php 1015 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use MediaWiki\Tests\Storage\PreMcrSchemaOverride;
  3. /**
  4. * Tests WikiPage against the pre-MCR, pre ContentHandler DB schema.
  5. *
  6. * @covers WikiPage
  7. *
  8. * @group WikiPage
  9. * @group Storage
  10. * @group ContentHandler
  11. * @group Database
  12. * @group medium
  13. */
  14. class WikiPageNoContentModelDbTest extends WikiPageDbTestBase {
  15. use PreMcrSchemaOverride;
  16. protected function getContentHandlerUseDB() {
  17. return false;
  18. }
  19. public function testGetDeletionUpdates() {
  20. $mainContent1 = new WikitextContent( '' );
  21. $title = Title::makeTitle( $this->getDefaultWikitextNS(), __METHOD__ );
  22. $page = new WikiPage( $title );
  23. $page = $this->createPage(
  24. $page,
  25. [ 'main' => $mainContent1 ]
  26. );
  27. $dataUpdates = $page->getDeletionUpdates( $page->getRevisionRecord() );
  28. $this->assertNotEmpty( $dataUpdates );
  29. $updateNames = array_map( function ( $du ) {
  30. return isset( $du->_name ) ? $du->_name : get_class( $du );
  31. }, $dataUpdates );
  32. $this->assertContains( LinksDeletionUpdate::class, $updateNames );
  33. }
  34. }