Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / maintenance / CommandLineInstallerTest.php
blob3c0f48ba32fc7a99e43b5d9ae28785b2c01eddc5
1 <?php
3 namespace MediaWiki\Tests\Maintenance;
5 use CommandLineInstaller;
7 /**
8 * @covers \CommandLineInstaller
9 * @author Dreamy Jazz
11 class CommandLineInstallerTest extends MaintenanceBaseTestCase {
12 public function getMaintenanceClass() {
13 return CommandLineInstaller::class;
16 public function testExecuteWhenHelpSpecified() {
17 $this->maintenance->setOption( 'help', 1 );
18 // ::maybeShowHelp uses ->mName which is null unless we call this.
19 $this->maintenance->setName( 'install.php' );
20 $this->expectCallToFatalError();
21 $this->expectOutputString( $this->maintenance->getParameters()->getHelp() . "\n" );
22 $this->maintenance->execute();
25 public function testExecuteWhenFirstArgumentProvidedButNotSecond() {
26 $this->maintenance->setArg( 'name', 'mediawiki' );
27 // ::maybeShowHelp uses ->mName which is null unless we call this.
28 $this->maintenance->setName( 'install.php' );
29 $this->expectCallToFatalError();
30 $this->expectOutputRegex( '/Argument \<admin\> is required/' );
31 $this->maintenance->execute();