public function testInstallFailsWithInvalidDbConfigWhenAllOptionsArePassedIn()
{
$application = $this->getApplication();
$application->add(new InstallCommand());
$command = $this->getApplication()->find('install');
$command->setCliArguments(array('--dbName=magento', '--dbHost=hostWhichDoesntExist', '--dbUser=user', '--dbPass=pa$$w0rd'));
$commandTester = new CommandTester($command);
try {
$commandTester->execute(array('command' => $command->getName(), '--noDownload' => true, '--installSampleData' => 'no', '--useDefaultConfigParams' => 'yes', '--installationFolder' => $this->installDir, '--dbHost' => 'hostWhichDoesNotExists', '--dbUser' => 'user', '--dbPass' => 'pa$$w0rd', '--dbName' => 'magento'));
} catch (\InvalidArgumentException $e) {
$this->assertEquals("Database configuration is invalid", $e->getMessage());
$display = $commandTester->getDisplay(true);
$this->assertContains('SQLSTATE', $display);
return;
}
$this->fail('InvalidArgumentException was not raised');
}