/** * Tests that connecting with invalid credentials or database name throws an exception * * @expectedException \Cake\Database\Exception\MissingConnectionException * @return void */ public function testWrongCredentials() { $config = ConnectionManager::config('test'); $this->skipIf(isset($config['url']), 'Datasource has dsn, skipping.'); $connection = new Connection(['database' => '/dev/nonexistent'] + ConnectionManager::config('test')); $connection->connect(); }
/** * Tests that connecting with invalid credentials or database name throws an exception * * @expectedException \Cake\Database\Error\MissingConnectionException * @return void **/ public function testWrongCredentials() { $config = ConnectionManager::config('test'); $this->skipIf(isset($config['dsn']), 'Datasource has dsn, skipping.'); $connection = new Connection(['database' => '_probably_not_there_'] + ConnectionManager::config('test')); $connection->connect(); }