Пример #1
0
 public static function setUpBeforeClass()
 {
     $dir = __DIR__ . '/../../../../../migration/Horde/Auth';
     if (!is_dir($dir)) {
         error_reporting(E_ALL & ~E_DEPRECATED);
         $dir = PEAR_Config::singleton()->get('data_dir', null, 'pear.horde.org') . '/Horde_Auth/migration';
         error_reporting(E_ALL | E_STRICT);
     }
     self::$migrator = new Horde_Db_Migration_Migrator(self::$db, null, array('migrationsPath' => $dir, 'schemaTableName' => 'horde_auth_test_schema'));
     self::$migrator->up();
     self::$auth = new Horde_Auth_Sql(array('db' => self::$db, 'encryption' => 'plain'));
     // Don't rely on auth->addUser as this is the unit under test
     $row = "INSERT INTO horde_users VALUES ('mozilla', 'liketokyo', NULL, NULL);";
     self::$db->execute($row);
     $row = "INSERT INTO horde_users VALUES ('konqui', 'kde', NULL, NULL);";
     self::$db->execute($row);
     $row = "INSERT INTO horde_users VALUES ('tux', 'fish', NULL, NULL);";
     self::$db->execute($row);
 }