From c51ca8350e869d0cead080fed11ddfd84d5d2208 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 2 Sep 2009 16:24:43 +0000 Subject: [PATCH] Proper connection exception handling in the DB functional tests. --- admin/report/unittest/dbtest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/report/unittest/dbtest.php b/admin/report/unittest/dbtest.php index cf9feab317..574fcdb966 100644 --- a/admin/report/unittest/dbtest.php +++ b/admin/report/unittest/dbtest.php @@ -54,13 +54,16 @@ for ($i=1; $i<=10; $i++) { } $dbinfos[$i]['installed'] = true; - if ($d->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions)) { + try { + $d->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions); $dbinfos[$i]['configured'] = true; if (data_submitted() and !empty($selected[$i])) { $tests[$i] = $d; } else { $d->dispose(); } + } catch (dml_connection_exception $e) { + $dbinfos[$i]['configured'] = false; } } -- 2.39.5