mirror of
https://github.com/dg/dibi.git
synced 2025-08-13 09:34:30 +02:00
Disconnect on not connected driver not fail (#222)
Sometimes database go away and Connection::isConnected() is returning TRUE. Prevent this should be posibble to disconnect on closed connection without error.
This commit is contained in:
@@ -36,3 +36,15 @@ test(function () use ($config) { // query string
|
||||
Assert::same($config['driver'], $conn->getConfig('driver'));
|
||||
Assert::type('Dibi\Driver', $conn->getDriver());
|
||||
});
|
||||
|
||||
|
||||
test(function () use ($config) {
|
||||
$conn = new Connection($config);
|
||||
Assert::true($conn->isConnected());
|
||||
|
||||
$conn->disconnect();
|
||||
Assert::false($conn->isConnected());
|
||||
|
||||
$conn->disconnect();
|
||||
Assert::false($conn->isConnected());
|
||||
});
|
||||
|
Reference in New Issue
Block a user