Beispiel #1
0
 function setUp()
 {
     $this->pdoSQLite = DABLPDO::factory(array('driver' => 'sqlite', 'dbname' => ':memory:'));
     return parent::setUp();
 }
Beispiel #2
0
 /**
  * (Re-)connect to the database connection named $key.
  *
  * @access private
  * @since 2010-10-29
  * @param string $key Connection name
  * @return DABLPDO Database connection
  * @throws PDOException If the connection fails
  */
 private static function connect($key)
 {
     if (array_key_exists($key, self::$connections)) {
         return self::$connections[$key];
     }
     if (!array_key_exists($key, self::$parameters)) {
         throw new RuntimeException('Connection "' . $key . '" has not been set');
     }
     $conn = DABLPDO::factory(self::$parameters[$key]);
     return self::$connections[$key] = $conn;
 }