function DbCommandBaseTest::testSpecifyDatabaseDoesNotExist
Invalid database names will throw a useful exception.
File
- 
              core/
modules/ system/ tests/ src/ Kernel/ Scripts/ DbCommandBaseTest.php, line 44  
Class
- DbCommandBaseTest
 - Test that the DbToolsApplication works correctly.
 
Namespace
Drupal\Tests\system\Kernel\ScriptsCode
public function testSpecifyDatabaseDoesNotExist() : void {
  $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.