1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 21:58:10 +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 2cbebc02c4
commit 9651835f5b

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' => '']);