From 0bd222b3f1decc1844adae382cbbc11040317d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A1la?= Date: Fri, 14 Feb 2020 12:40:54 +0100 Subject: [PATCH] tests: added reconnect test (#352) --- tests/dibi/Connection.connect.phpt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/dibi/Connection.connect.phpt b/tests/dibi/Connection.connect.phpt index d0ac395c..2582558e 100644 --- a/tests/dibi/Connection.connect.phpt +++ b/tests/dibi/Connection.connect.phpt @@ -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' => '']);