1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-03 12:47:33 +02:00

tests: added reconnect test (#352)

This commit is contained in:
Milan Pála
2020-02-14 12:40:54 +01:00
committed by David Grudl
parent 9f71f39470
commit 0bd222b3f1

View File

@@ -52,6 +52,17 @@ test(function () use ($config) {
});
test(function () use ($config) {
$conn = new Connection($config);
Assert::equal('hello', $conn->query('SELECT %s', 'hello')->fetchSingle());
$conn->disconnect();
$conn->connect();
Assert::equal('hello', $conn->query('SELECT %s', 'hello')->fetchSingle());
});
test(function () use ($config) {
Assert::exception(function () use ($config) {
new Connection($config + ['onConnect' => '']);