Page MenuHomeWickedGov Phorge

CommandLineInstallerTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

CommandLineInstallerTest.php

<?php
namespace MediaWiki\Tests\Maintenance;
use CommandLineInstaller;
/**
* @covers \CommandLineInstaller
* @author Dreamy Jazz
*/
class CommandLineInstallerTest extends MaintenanceBaseTestCase {
public function getMaintenanceClass() {
return CommandLineInstaller::class;
}
public function testExecuteWhenHelpSpecified() {
$this->maintenance->setOption( 'help', 1 );
// ::maybeShowHelp uses ->mName which is null unless we call this.
$this->maintenance->setName( 'install.php' );
$this->expectCallToFatalError();
$this->expectOutputString( $this->maintenance->getParameters()->getHelp() . "\n" );
$this->maintenance->execute();
}
public function testExecuteWhenFirstArgumentProvidedButNotSecond() {
$this->maintenance->setArg( 'name', 'mediawiki' );
// ::maybeShowHelp uses ->mName which is null unless we call this.
$this->maintenance->setName( 'install.php' );
$this->expectCallToFatalError();
$this->expectOutputRegex( '/Argument \<admin\> is required/' );
$this->maintenance->execute();
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Aug 19, 15:59 (3 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9b/9a/3ced791a54c50dbca6268a70dfdb
Default Alt Text
CommandLineInstallerTest.php (1 KB)

Event Timeline