From 3f03a597af3f827397231eddd1f24f202456173b Mon Sep 17 00:00:00 2001 From: Gabriele Pongelli Date: Sat, 25 Feb 2012 14:33:44 +0100 Subject: [PATCH] Removed JoomlaDatabasePostgresqlTestCase class. --- .../JoomlaDatabasePostgresqlTestCase.php | 133 ------------------ 1 file changed, 133 deletions(-) delete mode 100644 tests/includes/JoomlaDatabasePostgresqlTestCase.php diff --git a/tests/includes/JoomlaDatabasePostgresqlTestCase.php b/tests/includes/JoomlaDatabasePostgresqlTestCase.php deleted file mode 100644 index 15bc5d5f87..0000000000 --- a/tests/includes/JoomlaDatabasePostgresqlTestCase.php +++ /dev/null @@ -1,133 +0,0 @@ - isset($config) ? $config->dbtype : 'postgresql', - 'host' => isset($config) ? $config->host : '127.0.0.1', - 'user' => isset($config) ? $config->user : 'utuser', - 'password' => isset($config) ? $config->password : 'ut1234', - 'database' => isset($config) ? $config->db : 'joomla_ut', - 'prefix' => isset($config) ? $config->dbprefix : 'jos_'); - - try - { - self::$dbo = JDatabase::getInstance($options); - } - catch (RuntimeException $e) - { - } - - if (self::$dbo instanceof Exception) - { - // Ignore errors - define('DB_NOT_AVAILABLE', true); - } - } - - self::$database = JFactory::$database; - JFactory::$database = self::$dbo; - } - - /** - * This method is called after the last test of this test class is run. - * - * @return void - * - * @since 11.3 - */ - public static function tearDownAfterClass() - { - // JFactory::$database = self::$database; - } - - /** - * Sets the connection to the database - * - * @return connection - * - * @since 11.3 - */ - protected function getConnection() - { - // Load the config if available. - if (class_exists('JPostgreSQLTestConfig')) - { - $config = new JPostgreSQLTestConfig; - } - elseif (class_exists('JTestConfig')) - { - $config = new JTestConfig; - } - - $options = array( - 'driver' => ((isset($config)) && ($config->dbtype != 'postgresql')) ? $config->dbtype : 'pgsql', - 'host' => isset($config) ? $config->host : '127.0.0.1', - 'user' => isset($config) ? $config->user : 'utuser', - 'password' => isset($config) ? $config->password : 'ut1234', - 'database' => isset($config) ? $config->db : 'joomla_ut', - 'prefix' => isset($config) ? $config->dbprefix : 'jos_' - ); - - $pdo = new PDO($options['driver'] . ':host=' . $options['host'] . ';dbname=' . $options['database'], $options['user'], $options['password']); - - return $this->createDefaultDBConnection($pdo, $options['database']); - } - - /** - * Gets a mock database object. - * - * @return JDatabase - * - * @since 11.3 - */ - public function getMockDatabase() - { - // Load the real class first otherwise the mock will be used if jimport is called again. - require_once JPATH_PLATFORM . '/joomla/database/database.php'; - require_once JPATH_PLATFORM . '/joomla/database/database/postgresql.php'; - - // Load the mock class builder. - require_once JPATH_TESTS . '/includes/mocks/JDatabasePostgresqlMock.php'; - - return JDatabasePostgresqlMock::create($this); - } -}