diff options
| author | Igor Wiedler <igor@wiedler.ch> | 2012-07-21 17:43:43 +0200 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2012-07-21 18:11:14 +0200 |
| commit | 90a957ad26f52e26c3979464c5ac15b1fd0fcc28 (patch) | |
| tree | 8ddda79bc487e39172cd0e75573e5d0c775e74cb /tests/test_framework/phpbb_database_test_case.php | |
| parent | f7f78adeb910c84e86414dd6f6470631f5a47d8f (diff) | |
| download | forums-90a957ad26f52e26c3979464c5ac15b1fd0fcc28.tar forums-90a957ad26f52e26c3979464c5ac15b1fd0fcc28.tar.gz forums-90a957ad26f52e26c3979464c5ac15b1fd0fcc28.tar.bz2 forums-90a957ad26f52e26c3979464c5ac15b1fd0fcc28.tar.xz forums-90a957ad26f52e26c3979464c5ac15b1fd0fcc28.zip | |
[ticket/11015] Make DBAL classes autoloadable
PHPBB3-11015
This allows us to just create the object without having to include the
driver first. However, it also means that users must specify the full
class name in config.php
Diffstat (limited to 'tests/test_framework/phpbb_database_test_case.php')
| -rw-r--r-- | tests/test_framework/phpbb_database_test_case.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index bb86df0ef0..abc3c8d7a3 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -33,7 +33,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test $db_config = $this->get_database_config(); // Firebird requires table and column names to be uppercase - if ($db_config['dbms'] == 'firebird') + if ($db_config['dbms'] == 'phpbb_db_driver_firebird') { $xml_data = file_get_contents($path); $xml_data = preg_replace_callback('/(?:(<table name="))([a-z_]+)(?:(">))/', 'phpbb_database_test_case::to_upper', $xml_data); @@ -100,9 +100,8 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test $config = $this->get_database_config(); - require_once dirname(__FILE__) . '/../../phpBB/includes/db/' . $config['dbms'] . '.php'; - $dbal = 'dbal_' . $config['dbms']; - $db = new $dbal(); + $dbms = $config['dbms']; + $db = new $dbms(); $db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport']); return $db; |
