Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / maintenance / DeleteTagTest.php
blobadc262002ec810a487ba48d3f5222efec71a4881
1 <?php
3 namespace MediaWiki\Tests\Maintenance;
5 use DeleteTag;
7 /**
8 * @covers \DeleteTag
9 * @group Database
10 * @author Dreamy Jazz
12 class DeleteTagTest extends MaintenanceBaseTestCase {
14 protected function getMaintenanceClass() {
15 return DeleteTag::class;
18 public function testExecuteForNonExistingTag() {
19 $this->maintenance->setArg( 'tag name', 'abcedef' );
20 $this->expectOutputRegex( "/Tag 'abcedef' not found/" );
21 $this->expectCallToFatalError();
22 $this->maintenance->execute();
25 public function testExecuteForSoftwareDefinedTag() {
26 // Get a page which has a mw-blank tag
27 $testPage = $this->getExistingTestPage();
28 $this->editPage( $testPage, '' );
29 // Run the maintenance script and try to remove the mw-blank tag
30 $this->maintenance->setArg( 'tag name', 'mw-blank' );
31 $this->expectOutputRegex(
32 "/Tags defined by an extension cannot be deleted unless the extension specifically allows it/"
34 $this->expectCallToFatalError();
35 $this->maintenance->execute();