示例#1
0
 public static function setUpBeforeClass()
 {
     $factory_db = new Horde_Test_Factory_Db();
     try {
         self::$db = $factory_db->create();
         parent::setUpBeforeClass();
     } catch (Horde_Test_Exception $e) {
         self::$reason = 'Sqlite not available.';
     }
 }
示例#2
0
文件: Base.php 项目: jubinpatel/horde
 public static function tearDownAfterClass()
 {
     if (self::$migrator) {
         self::$migrator->down();
     }
     if (self::$db) {
         self::$db->disconnect();
         self::$db = null;
     }
     parent::tearDownAfterClass();
 }
示例#3
0
文件: Locks.php 项目: raz0rsdge/horde
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     if (is_dir(__DIR__ . '/../../../../../../Lock/migration')) {
         $lockMigrationsPath = __DIR__ . '/../../../../../../Lock/migration';
     } elseif (is_dir(__DIR__ . '/../../../../../../deps/Lock/migration')) {
         $lockMigrationsPath = __DIR__ . '/../../../../../../deps/Lock/migration';
         // how would that work for any possible pear_dir ?
     } else {
         self::$skip = 'Could not determine path to Horde_Lock migration';
         return;
     }
     self::$locksMigrator = new Horde_Db_Migration_Migrator(self::$db, null, array('migrationsPath' => $lockMigrationsPath, 'schemaTableName' => 'horde_lock_schema_info'));
     self::$locksMigrator->up();
     self::$locks = new Horde_Lock_Sql(array('db' => self::$db));
     self::$auth = new Horde_Auth_Sql(array('db' => self::$db, 'encryption' => 'plain', 'lock_api' => self::$locks));
 }