예제 #1
0
 protected static function _getConnection($overrides = array())
 {
     $config = Horde_Test_Case::getConfig('DB_ADAPTER_MYSQL_TEST_CONFIG', null, array('host' => 'localhost', 'username' => '', 'password' => '', 'dbname' => 'test'));
     if (isset($config['db']['adapter']['mysql']['test']) && is_array($config['db']['adapter']['mysql']['test'])) {
         $config = $config['db']['adapter']['mysql']['test'];
     } else {
         self::$_skip = true;
         self::$_reason = 'No configuration for mysql test';
         return;
     }
     $config = array_merge($config, $overrides);
     $conn = new Horde_Db_Adapter_Mysql($config);
     $cache = new Horde_Cache(new Horde_Cache_Storage_Mock());
     $conn->setCache($cache);
     return array($conn, $cache);
 }
예제 #2
0
 protected static function _getConnection($overrides = array())
 {
     $config = Horde_Test_Case::getConfig('DB_ADAPTER_PDO_PGSQL_TEST_CONFIG', __DIR__ . '/..', array('username' => '', 'password' => '', 'dbname' => 'test'));
     if (isset($config['db']['adapter']['pdo']['pgsql']['test'])) {
         $config = $config['db']['adapter']['pdo']['pgsql']['test'];
     }
     if (!is_array($config)) {
         self::$_skip = true;
         self::$_reason = 'No configuration for pdo_pgsql test';
         return;
     }
     $config = array_merge($config, $overrides);
     $conn = new Horde_Db_Adapter_Pdo_Pgsql($config);
     $cache = new Horde_Cache(new Horde_Cache_Storage_Mock());
     $conn->setCache($cache);
     return array($conn, $cache);
 }
예제 #3
0
 protected static function _getConnection($overrides = array())
 {
     $config = Horde_Test_Case::getConfig('DB_ADAPTER_OCI8_TEST_CONFIG', null, array('host' => 'localhost', 'username' => '', 'password' => '', 'dbname' => 'test'));
     if (isset($config['db']['adapter']['oci8']['test'])) {
         $config = $config['db']['adapter']['oci8']['test'];
     }
     if (!is_array($config)) {
         self::$_skip = true;
         self::$_reason = 'No configuration for oci8 test';
         return;
     }
     $config = array_merge($config, $overrides);
     $conn = new Horde_Db_Adapter_Oci8($config);
     $cache = new Horde_Cache(new Horde_Cache_Storage_Mock());
     $conn->setCache($cache);
     //$conn->setLogger(new Horde_Log_Logger(new Horde_Log_Handler_Cli()));
     $conn->reconnect();
     return array($conn, $cache);
 }