public function ConnectionTest::testAccessDeniedException in Drupal driver for SQL Server and SQL Azure 4.2.x
Same name and namespace in other branches
- 3.1.x tests/src/Kernel/ConnectionTest.php \Drupal\Tests\sqlsrv\Kernel\ConnectionTest::testAccessDeniedException()
- 4.0.x tests/src/Kernel/ConnectionTest.php \Drupal\Tests\sqlsrv\Kernel\ConnectionTest::testAccessDeniedException()
- 4.1.x tests/src/Kernel/ConnectionTest.php \Drupal\Tests\sqlsrv\Kernel\ConnectionTest::testAccessDeniedException()
Test AccessDeniedException is thrown.
File
- tests/
src/ Kernel/ ConnectionTest.php, line 56
Class
- ConnectionTest
- Tests of the sqlsrv database system.
Namespace
Drupal\Tests\sqlsrv\KernelCode
public function testAccessDeniedException() {
$connection_array = [
'driver' => 'sqlsrv',
'database' => 'mydrupalsite',
'username' => 'sa',
'password' => 'incorrect!',
'host' => 'localhost',
'schema' => 'dbo',
'cache_schema' => 'true',
];
$this
->expectException(DatabaseAccessDeniedException::class);
// Generate an exception
$this->connection
->open($connection_array);
}