當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhraseanetTestCase::fixtureIds方法代碼示例

本文整理匯總了PHP中PhraseanetTestCase::fixtureIds方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhraseanetTestCase::fixtureIds方法的具體用法?PHP PhraseanetTestCase::fixtureIds怎麽用?PHP PhraseanetTestCase::fixtureIds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhraseanetTestCase的用法示例。


在下文中一共展示了PhraseanetTestCase::fixtureIds方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     if (null !== self::$DI) {
         unset(self::$DI['app']['dbal.provider']);
     }
     self::$DI = new \Pimple();
     ini_set('memory_limit', '4096M');
     \PHPUnit_Framework_Error_Warning::$enabled = true;
     \PHPUnit_Framework_Error_Notice::$enabled = true;
     self::$DI['app'] = self::$DI->share(function ($DI) {
         return $this->loadApp('/lib/Alchemy/Phrasea/Application/Root.php');
     });
     self::$DI['cli'] = self::$DI->share(function ($DI) {
         return $this->loadCLI();
     });
     self::$DI['local-guzzle'] = self::$DI->share(function ($DI) {
         return new Guzzle(self::$DI['app']['conf']->get('servername'));
     });
     self::$DI['client'] = self::$DI->share(function ($DI) {
         return new Client($DI['app'], []);
     });
     self::$DI['user'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.user']->getRepository()->find(self::$fixtureIds['user']['test_phpunit']);
     });
     self::$DI['user_1'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.user']->getRepository()->find(self::$fixtureIds['user']['user_1']);
     });
     self::$DI['user_2'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.user']->getRepository()->find(self::$fixtureIds['user']['user_2']);
     });
     self::$DI['user_3'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.user']->getRepository()->find(self::$fixtureIds['user']['user_3']);
     });
     self::$DI['user_guest'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.user']->getRepository()->find(self::$fixtureIds['user']['user_guest']);
     });
     self::$DI['user_notAdmin'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.user']->getRepository()->find(self::$fixtureIds['user']['test_phpunit_not_admin']);
     });
     self::$DI['user_alt1'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.user']->getRepository()->find(self::$fixtureIds['user']['test_phpunit_alt1']);
     });
     self::$DI['user_alt2'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.user']->getRepository()->find(self::$fixtureIds['user']['test_phpunit_alt2']);
     });
     self::$DI['user_template'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.user']->getRepository()->find(self::$fixtureIds['user']['user_template']);
     });
     self::$DI['registration_1'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.registration']->getRepository()->find(self::$fixtureIds['registrations']['registration_1']);
     });
     self::$DI['registration_2'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.registration']->getRepository()->find(self::$fixtureIds['registrations']['registration_2']);
     });
     self::$DI['registration_3'] = self::$DI->share(function ($DI) {
         return $DI['app']['manipulator.registration']->getRepository()->find(self::$fixtureIds['registrations']['registration_3']);
     });
     self::$DI['oauth2-app-user'] = self::$DI->share(function ($DI) {
         return new \API_OAuth2_Application($DI['app'], self::$fixtureIds['oauth']['user']);
     });
     self::$DI['oauth2-app-user_notAdmin'] = self::$DI->share(function ($DI) {
         return new \API_OAuth2_Application($DI['app'], self::$fixtureIds['oauth']['user_notAdmin']);
     });
     self::$DI['logger'] = self::$DI->share(function () {
         $logger = new Logger('tests');
         $logger->pushHandler(new NullHandler());
         return $logger;
     });
     self::$DI['collection'] = self::$DI->share(function ($DI) {
         return collection::get_from_base_id($DI['app'], self::$fixtureIds['collection']['coll']);
     });
     self::$DI['collection_no_access'] = self::$DI->share(function ($DI) {
         return collection::get_from_base_id($DI['app'], self::$fixtureIds['collection']['coll_no_access']);
     });
     self::$DI['collection_no_access_by_status'] = self::$DI->share(function ($DI) {
         return collection::get_from_base_id($DI['app'], self::$fixtureIds['collection']['coll_no_status']);
     });
     if (!self::$booted) {
         if (!self::$DI['app']['phraseanet.configuration-tester']->isInstalled()) {
             echo "[0;31mPhraseanet is not set up[0;37m\n";
             exit(1);
         }
         self::$fixtureIds = array_merge(self::$fixtureIds, json_decode(file_get_contents(__DIR__ . '/../fixtures.json'), true));
         self::resetUsersRights(self::$DI['app'], self::$DI['user']);
         self::resetUsersRights(self::$DI['app'], self::$DI['user_notAdmin']);
         self::$booted = true;
     }
     self::$DI['lazaret_1'] = self::$DI->share(function ($DI) {
         return $DI['app']['EM']->find('Phraseanet:LazaretFile', self::$fixtureIds['lazaret']['lazaret_1']);
     });
     foreach (range(1, 7) as $i) {
         self::$DI['record_' . $i] = self::$DI->share(function ($DI) use($i) {
             return new \record_adapter($DI['app'], self::$fixtureIds['databox']['records'], self::$fixtureIds['record']['record_' . $i]);
         });
     }
     foreach (range(1, 3) as $i) {
         self::$DI['record_story_' . $i] = self::$DI->share(function ($DI) use($i) {
             return new \record_adapter($DI['app'], self::$fixtureIds['databox']['records'], self::$fixtureIds['record']['record_story_' . $i]);
         });
//.........這裏部分代碼省略.........
開發者ID:romainneutron,項目名稱:Phraseanet,代碼行數:101,代碼來源:PhraseanetTestCase.php

示例2: deleteResources

 /**
  * Deletes previously created Resources.
  */
 private static function deleteResources()
 {
     if (!empty(self::$recordsInitialized)) {
         foreach (self::$recordsInitialized as $i) {
             self::$DI['record_' . $i]->delete();
         }
         self::$recordsInitialized = [];
     }
     // Clear fixtures
     self::$fixtureIds = [];
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:14,代碼來源:PhraseanetTestCase.php


注:本文中的PhraseanetTestCase::fixtureIds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。