1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[task/mssql-db-tests] Split up database tests into SELECT and write operations

SELECT is based on the user table fixture, write (INSERT/UPDATE/DELETE) is
tested using the config table fixture.

PHPBB3-9868
This commit is contained in:
Nils Adermann
2010-10-25 19:20:51 +02:00
parent 9b4da98653
commit fa8dca2400
5 changed files with 200 additions and 178 deletions

View File

@@ -9,6 +9,8 @@
abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_TestCase
{
private static $already_connected;
protected $test_case_helpers;
public function get_test_case_helpers()
@@ -333,23 +335,21 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
public function getConnection()
{
static $already_connected;
$config = $this->get_database_config();
$dbms = $this->get_dbms_data($config['dbms']);
if (!$already_connected)
if (!self::$already_connected)
{
$this->recreate_db($config, $dbms);
}
$pdo = $this->new_pdo($config, $dbms, true);
if (!$already_connected)
if (!self::$already_connected)
{
$this->load_schema($pdo, $config, $dbms);
$already_connected = true;
self::$already_connected = true;
}
return $this->createDefaultDBConnection($pdo, 'testdb');