Skip to content

Commit a305573

Browse files
committed
tests: fix for failing DB
1 parent 829b936 commit a305573

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/Database/Connection.lazy.phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ test(function () { // connect & disconnect
4040
$options = Tester\Environment::loadData() + ['user' => NULL, 'password' => NULL];
4141
$connections = 1;
4242

43-
$connection = new Nette\Database\Connection($options['dsn'], $options['user'], $options['password']);
43+
try {
44+
$connection = new Nette\Database\Connection($options['dsn'], $options['user'], $options['password']);
45+
} catch (PDOException $e) {
46+
Tester\Environment::skip("Connection to '$options[dsn]' failed. Reason: " . $e->getMessage());
47+
}
4448
$connection->onConnect[] = function () use (& $connections) {
4549
$connections++;
4650
};

0 commit comments

Comments
 (0)