X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fcontent%2FWikitextContentHandlerTest.php;h=806038a06bf978499cd1b35cd3a16bbd9a0244b9;hb=7960d5385f1146459671148e2e34d3ba50e17aeb;hp=59984d85e992ba932ab2c026cd9b49765f921e13;hpb=967a96e7fa5910f8fc451590decb381dbfb481ba;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/includes/content/WikitextContentHandlerTest.php index 59984d85e9..806038a06b 100644 --- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php +++ b/tests/phpunit/includes/content/WikitextContentHandlerTest.php @@ -1,5 +1,8 @@ resetNamespaces(); + MediaWikiServices::getInstance()->getContentLanguage()->resetNamespaces(); - MagicWord::clearCache(); + MediaWikiServices::getInstance()->resetServiceForTesting( 'MagicWordFactory' ); if ( is_string( $title ) ) { $title = Title::newFromText( $title ); @@ -362,4 +364,30 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase { $this->assertArrayHasKey( 'file_text', $data ); $this->assertEquals( 'This is file content', $data['file_text'] ); } + + public function testGetSecondaryDataUpdates() { + $title = Title::newFromText( 'Somefile.jpg', NS_FILE ); + $content = new WikitextContent( '' ); + + /** @var SlotRenderingProvider $srp */ + $srp = $this->getMock( SlotRenderingProvider::class ); + + $handler = new WikitextContentHandler(); + $updates = $handler->getSecondaryDataUpdates( $title, $content, 'main', $srp ); + + $this->assertEquals( [], $updates ); + } + + public function testGetDeletionUpdates() { + $title = Title::newFromText( 'Somefile.jpg', NS_FILE ); + $content = new WikitextContent( '' ); + + $srp = $this->getMock( SlotRenderingProvider::class ); + + $handler = new WikitextContentHandler(); + $updates = $handler->getDeletionUpdates( $title, 'main' ); + + $this->assertEquals( [], $updates ); + } + }