aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2012-02-21 11:17:21 -0500
committerDavid King <imkingdavid@gmail.com>2012-03-19 09:12:33 -0400
commitd235262bc21657f0693501ac1154e1443578d507 (patch)
treeb2ec9edc55b93f236fb62f5560b99d0a62cd3b0d /tests/test_framework
parenta37a28b48546afc880446db7e4b2fd87c70a6cda (diff)
downloadforums-d235262bc21657f0693501ac1154e1443578d507.tar
forums-d235262bc21657f0693501ac1154e1443578d507.tar.gz
forums-d235262bc21657f0693501ac1154e1443578d507.tar.bz2
forums-d235262bc21657f0693501ac1154e1443578d507.tar.xz
forums-d235262bc21657f0693501ac1154e1443578d507.zip
[ticket/10586] Adding the extensions used by the tests
PHPBB3-10586
Diffstat (limited to 'tests/test_framework')
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index b2ae215d91..9797ecfef8 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -14,6 +14,8 @@ class phpbb_functional_test_case extends phpbb_test_case
protected $client;
protected $root_url;
+ protected $db = null;
+
static protected $config = array();
static protected $already_installed = false;
@@ -69,14 +71,18 @@ class phpbb_functional_test_case extends phpbb_test_case
protected function get_db()
{
global $phpbb_root_path, $phpEx;
- if (!class_exists('dbal_' . self::$config['dbms']))
+ // so we don't reopen an open connection
+ if (!($this->db instanceof dbal))
{
- include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx");
+ if (!class_exists('dbal_' . self::$config['dbms']))
+ {
+ include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx");
+ }
+ $sql_db = 'dbal_' . self::$config['dbms'];
+ $this->db = new $sql_db();
+ $this->db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
}
- $sql_db = 'dbal_' . self::$config['dbms'];
- $db = new $sql_db();
- $db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
- return $db;
+ return $this->db;
}
protected function get_ext_manager()