function DbCommandBaseTest::testSpecifyDatabaseDoesNotExist
Same name in other branches
- 9 core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php \Drupal\Tests\system\Kernel\Scripts\DbCommandBaseTest::testSpecifyDatabaseDoesNotExist()
- 10 core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php \Drupal\Tests\system\Kernel\Scripts\DbCommandBaseTest::testSpecifyDatabaseDoesNotExist()
- 11.x core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php \Drupal\Tests\system\Kernel\Scripts\DbCommandBaseTest::testSpecifyDatabaseDoesNotExist()
Invalid database names will throw a useful exception.
File
-
core/
modules/ system/ tests/ src/ Kernel/ Scripts/ DbCommandBaseTest.php, line 47
Class
- DbCommandBaseTest
- Test that the DbToolsApplication works correctly.
Namespace
Drupal\Tests\system\Kernel\ScriptsCode
public function testSpecifyDatabaseDoesNotExist() {
$command = new DbCommandBaseTester();
$command_tester = new CommandTester($command);
$command_tester->execute([
'--database' => 'dne',
]);
$this->expectException(ConnectionNotDefinedException::class);
$command->getDatabaseConnection($command_tester->getInput());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.