public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $CI =& get_instance();
     $CI->load->library('Seeder');
     $CI->seeder->call('CategorySeeder');
 }
Exemplo n.º 2
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER1, true);
     self::loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER2, true);
     self::loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER3, true);
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $CI =& get_instance();
     $CI->load->database();
     $CI->db->truncate('keys');
 }
Exemplo n.º 4
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $serviceStates = static::$_client->server()->getServiceStates();
     static::$_isMailSupported = $serviceStates['smtp'] && 'running' == $serviceStates['smtp']['state'];
     static::$_webspace = static::_createWebspace('example.dom');
 }
Exemplo n.º 5
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // trashbin hooks
     \OCA\Files_Trashbin\Trashbin::registerHooks();
     // create test user
     self::loginHelper(self::TEST_ENCRYPTION_TRASHBIN_USER1, true);
 }
Exemplo n.º 6
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$defaultTimeZone = date_default_timezone_get();
     date_default_timezone_set('UTC');
     self::$oneDay = self::$oneHour * 24;
     self::$oneYear = self::$oneDay * 365;
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     if (!defined('ONPHP_CURL_TEST_URL')) {
         self::$failTestMsg = 'not defined test constant ONPHP_CURL_TEST_URL';
     }
     self::$emptyMsg = file_get_contents(ONPHP_CURL_TEST_URL);
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$application = \Stormpath\Resource\Application::instantiate(array('name' => uniqid() . 'ApplicationTest', 'description' => 'Description of Main App', 'status' => 'enabled'));
     self::createResource(\Stormpath\Resource\Application::PATH, self::$application, array('createDirectory' => true));
     self::$account = \Stormpath\Resource\Account::instantiate(array('givenName' => 'Account Name', 'middleName' => 'Middle Name', 'surname' => 'Surname', 'username' => 'username' . uniqid(), 'email' => 'username' . uniqid() . '@unknown123.kot', 'password' => 'superP4ss'));
     self::$application->createAccount(self::$account);
     self::$provider = new \Stormpath\StormpathUserProvider(self::$client, self::$application);
 }
Exemplo n.º 9
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // note: not using a data provider because these
     // files all need to coexist to make sure the
     // share keys are found properly (pattern matching)
     self::$testFiles = array('t est.txt', 't est_.txt', 't est.doc.txt', 't est(.*).txt', 'multiple.dots.can.happen.too.txt', 't est.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.txt', 't est_.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey.txt', 'who would upload their.shareKey', 'user ones file.txt', 'user ones file.txt.backup', '.t est.txt');
     // create test user
     self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER1, true);
     self::loginHelper(self::TEST_ENCRYPTION_HOOKS_USER2, true);
 }
Exemplo n.º 10
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // disable file proxy by default
     \OC_FileProxy::$enabled = false;
     // remember files_trashbin state
     self::$stateFilesTrashbin = \OC_App::isEnabled('files_trashbin');
     // we don't want to tests with app files_trashbin enabled
     \OC_App::disable('files_trashbin');
     // create test user
     \OC_User::deleteUser(self::TEST_USER);
     parent::loginHelper(self::TEST_USER, true);
 }
Exemplo n.º 11
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // create test user
     self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER1, true);
     self::loginHelper(self::TEST_ENCRYPTION_UTIL_USER2, true);
     self::loginHelper(self::TEST_ENCRYPTION_UTIL_LEGACY_USER, true);
     // create groups
     \OC_Group::createGroup(self::TEST_ENCRYPTION_UTIL_GROUP1);
     \OC_Group::createGroup(self::TEST_ENCRYPTION_UTIL_GROUP2);
     // add user 1 to group1
     \OC_Group::addToGroup(self::TEST_ENCRYPTION_UTIL_USER1, self::TEST_ENCRYPTION_UTIL_GROUP1);
 }
Exemplo n.º 12
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // enable resharing
     \OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', 'yes');
     // register share hooks
     \OC::registerShareHooks();
     \OCA\Files_Sharing\Helper::registerHooks();
     // clear and register hooks
     \OC_FileProxy::register(new \OCA\Files\Share\Proxy());
     // create users
     self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER1, true);
     self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER2, true);
     self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER3, true);
     self::loginHelper(self::TEST_ENCRYPTION_SHARE_USER4, true);
     // create group and assign users
     \OC_Group::createGroup(self::TEST_ENCRYPTION_SHARE_GROUP1);
     \OC_Group::addToGroup(self::TEST_ENCRYPTION_SHARE_USER3, self::TEST_ENCRYPTION_SHARE_GROUP1);
     \OC_Group::addToGroup(self::TEST_ENCRYPTION_SHARE_USER4, self::TEST_ENCRYPTION_SHARE_GROUP1);
 }
Exemplo n.º 13
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$ci =& get_instance();
 }
 /**
  * This method is called before the first test of this test class is run.
  *
  * @since Method available since Release 3.4.0
  */
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
 }
Exemplo n.º 15
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     /**
      * get config
      */
     if (isset($_SERVER['TRAVIS_DB'])) {
         static::$config = static::$travis_dbs[$_SERVER['TRAVIS_DB']];
     } else {
         static::$config = (include APPPATH . 'config' . DS . \Fuel::DEVELOPMENT . DS . 'dbdocs.php');
         static::$config = \Arr::get(static::$config, 'test_config.db');
     }
     /**
      * connect to db
      */
     static::$dd = Dbdocs::forge('default', static::$config);
     /**
      * drop views
      */
     krsort(static::$test_views);
     foreach (static::$test_views as $test_view_name => $sql) {
         try {
             //TODO: check view exist
             static::$dd->sm->dropView($test_view_name);
         } catch (\Doctrine\DBAL\DBALException $e) {
             //do nothing
         }
     }
     /**
      * drop tables
      */
     krsort(static::$test_tables);
     foreach (static::$test_tables as $test_table_name => $infos) {
         static::$dd->sm->tablesExist($test_table_name) and static::$dd->sm->dropTable($test_table_name);
     }
     /**
      * create tables
      */
     ksort(static::$test_tables);
     foreach (static::$test_tables as $test_table_name => $infos) {
         $table = new \Doctrine\DBAL\Schema\Table($test_table_name);
         foreach ($infos['columns'] as $column) {
             empty($column['options']) and $column['options'] = array();
             $table->addColumn($column['name'], $column['type'], $column['options']);
         }
         $table->setPrimaryKey($infos['primary_keys']);
         if (!empty($infos['foreign_keys'])) {
             foreach ($infos['foreign_keys'] as $foreign_key) {
                 list($to_table_name, $to_column_name) = explode(".", $foreign_key['to']);
                 $table->addForeignKeyConstraint($to_table_name, array($foreign_key['from']), array($to_column_name));
             }
         }
         static::$dd->sm->createTable($table);
     }
     /**
      * create views
      */
     ksort(static::$test_views);
     foreach (static::$test_views as $test_view_name => $sql) {
         $view = new \Doctrine\DBAL\Schema\View($test_view_name, $sql);
         static::$dd->sm->createView($view);
     }
 }
Exemplo n.º 16
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     \OCA\Files_Sharing\Helper::registerHooks();
 }
Exemplo n.º 17
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // create test user
     self::loginHelper(self::TEST_ENCRYPTION_STREAM_USER1, true);
 }
Exemplo n.º 18
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     static::$_webspace = static::_createWebspace('example.dom');
 }