aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework/phpbb_test_case_helpers.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-11-03 11:58:48 +0100
committerAndreas Fischer <bantu@phpbb.com>2010-11-03 11:58:48 +0100
commitf164906d77d3c8cb5650bb1e70db8e233f726d4c (patch)
treecb403f103373dfeb833a737615dbd8ed09aa30c7 /tests/test_framework/phpbb_test_case_helpers.php
parent36820a4f4f099b20d83044416ec208c7a4cbf63c (diff)
parente3b460a518e46ad910345199ee85e94d3134fd3e (diff)
downloadforums-f164906d77d3c8cb5650bb1e70db8e233f726d4c.tar
forums-f164906d77d3c8cb5650bb1e70db8e233f726d4c.tar.gz
forums-f164906d77d3c8cb5650bb1e70db8e233f726d4c.tar.bz2
forums-f164906d77d3c8cb5650bb1e70db8e233f726d4c.tar.xz
forums-f164906d77d3c8cb5650bb1e70db8e233f726d4c.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [task/mssql-db-tests] Remove MS SQL helper values from SELECT LIMIT results. [task/mssql-db-tests] Split up database tests into SELECT and write operations [task/mssql-db-tests] PHPUnit output got stuck after unterminated ob_start. [task/mssql-db-tests] sql_query_limit must return all results when total = 0 [task/mssql-db-tests] Add support for odbc & sqlsrv PDO test connections [task/mssql-db-tests] Refactored getConnection into multiple smaller parts. [task/mssql-db-tests] Allow test configuration with environment variables. [task/mssql-db-tests] No longer display an error when skipping db tests. [task/mssql-db-tests] Use a simple getter for test case helpers. Conflicts: tests/template/template.php
Diffstat (limited to 'tests/test_framework/phpbb_test_case_helpers.php')
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php68
1 files changed, 0 insertions, 68 deletions
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 7c026e496e..0acdce32e0 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -18,74 +18,6 @@ class phpbb_test_case_helpers
$this->test_case = $test_case;
}
- public function get_database_config()
- {
- static $show_error = true;
-
- if (file_exists('test_config.php'))
- {
- include('test_config.php');
-
- return array(
- 'dbms' => $dbms,
- 'dbhost' => $dbhost,
- 'dbport' => $dbport,
- 'dbname' => $dbname,
- 'dbuser' => $dbuser,
- 'dbpasswd' => $dbpasswd,
- );
- }
- else if (extension_loaded('sqlite') && version_compare(PHPUnit_Runner_Version::id(), '3.4.15', '>='))
- {
- // Silently use sqlite
- return array(
- 'dbms' => 'sqlite',
- 'dbhost' => 'phpbb_unit_tests.sqlite2', // filename
- 'dbport' => '',
- 'dbname' => '',
- 'dbuser' => '',
- 'dbpasswd' => '',
- );
- }
- else
- {
- if ($show_error)
- {
- $show_error = false;
- }
- else
- {
- $this->test_case->markTestSkipped('Missing test_config.php: See first error.');
- return;
- }
-
- trigger_error("You have to create a test_config.php like this:
-\"<?php
-\$dbms = 'mysqli';
-\$dbhost = 'localhost';
-\$dbport = '';
-\$dbname = 'database';
-\$dbuser = 'user';
-\$dbpasswd = 'password';
-\"
-
-NOTE: The database is dropped and recreated with the phpbb-db-schema! Do NOT specify a database with important data.", E_USER_ERROR);
- }
- }
-
- public function new_dbal()
- {
- global $phpbb_root_path, $phpEx;
- $config = $this->get_database_config();
-
- require_once '../phpBB/includes/db/' . $config['dbms'] . '.php';
- $dbal = 'dbal_' . $config['dbms'];
- $db = new $dbal();
- $db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport']);
-
- return $db;
- }
-
public function setExpectedTriggerError($errno, $message = '')
{
$exceptionName = '';