From 0afdb5619b6185d40e2cf9f45d106bed6764488b Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sun, 10 Feb 2019 11:08:18 +0000 Subject: [PATCH] fix tests --- tests/bootstrap.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 444feda0..277d912e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -12,8 +12,6 @@ $CONF['language_hook'] = ''; $db_file = dirname(__FILE__) . '/postfixadmin.sqlite.test'; -touch($db_file); - $CONF['database_type'] = 'sqlite'; $CONF['database_name'] = $db_file; @@ -26,5 +24,14 @@ if (file_exists($db_file)) { unlink($db_file); } +touch($db_file); + +list($db, $error_text) = db_connect_with_errors(); + +if($db === false) { + echo "failed to connect to database\n"; + echo $error_text; + exit(1); +} require_once(dirname(__FILE__) . '/../public/upgrade.php');