From b26fc42ac47f8be20aa83cb50f79c9b3454f2fbf Mon Sep 17 00:00:00 2001 From: alban Date: Sat, 22 Mar 2014 15:39:37 +0100 Subject: [PATCH] Updates bootstrap Adds a THROW_EXCEPTION const Force connect the db as otherwise mysql_escape fails --- phpunit/bootstrap.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpunit/bootstrap.php b/phpunit/bootstrap.php index a01d6017..e2e40dd2 100644 --- a/phpunit/bootstrap.php +++ b/phpunit/bootstrap.php @@ -17,7 +17,8 @@ AutoLoader::registerDirectory('lib'); AutoLoader::registerDirectory('../bureau/class'); AutoLoader::registerDirectory('.'); -define('ALTERNC_PANEL', "../bureau"); // Custom +define('ALTERNC_PANEL',realpath(__DIR__."/../bureau"));; // Custom +define('PHPUNIT_DATASETS_PATH',realpath(__DIR__."/tests/_datasets")); require_once ALTERNC_PANEL."/class/db_mysql.php"; require_once ALTERNC_PANEL."/class/functions.php"; @@ -66,6 +67,7 @@ define('ALTERNC_APACHE2_GEN_TMPL_DIR', '/etc/alternc/templates/apache2/'); define('ALTERNC_VHOST_DIR', "/var/lib/alternc/apache-vhost/"); define('ALTERNC_VHOST_FILE', ALTERNC_VHOST_DIR."vhosts_all.conf"); define('ALTERNC_VHOST_MANUALCONF', ALTERNC_VHOST_DIR."manual/"); +define("THROW_EXCEPTIONS", TRUE); $root = ALTERNC_PANEL."/"; // Create test directory @@ -144,6 +146,7 @@ foreach ($queryList as $exec_command) { } } $db = new \DB_system($user,$database,$password); +$db->connect(); $cuid = 0; $variables = new \m_variables(); $mem = new \m_mem();