1
0
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:
Milan Pála
2016-06-13 21:17:57 +02:00
committed by David Grudl
parent b7d84b90ef
commit 6510fcce25
9 changed files with 20 additions and 8 deletions

View File

@@ -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());
});