当前位置: 首页>>代码示例>>PHP>>正文


PHP ProjectManager::clearInstance方法代码示例

本文整理汇总了PHP中ProjectManager::clearInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectManager::clearInstance方法的具体用法?PHP ProjectManager::clearInstance怎么用?PHP ProjectManager::clearInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectManager的用法示例。


在下文中一共展示了ProjectManager::clearInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tearDown

 public function tearDown()
 {
     UserManager::clearInstance();
     ProjectManager::clearInstance();
     SystemEventManager::clearInstance();
     unset($GLOBALS['Language']);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:ProjectCreatorTest.php

示例2: tearDown

 public function tearDown()
 {
     UserManager::clearInstance();
     ProjectManager::clearInstance();
     SystemEventManager::clearInstance();
     parent::tearDown();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:OneStepProjectCreationValidatorTest.php

示例3: tearDown

 public function tearDown()
 {
     parent::tearDown();
     $this->item_id++;
     PermissionsManager::clearInstance();
     ProjectManager::clearInstance();
     Docman_ItemFactory::clearInstance($this->project->getID());
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:PermissionsItemManagerTest.php

示例4: itCreatesAProject

 public function itCreatesAProject()
 {
     $projectCreator = new ProjectCreator(ProjectManager::instance(), ReferenceManager::instance());
     $projectCreator->create('short-name', 'Long name', array('project' => array('form_short_description' => '', 'is_test' => false, 'is_public' => false, 'services' => array(), 'built_from_template' => 100)));
     ProjectManager::clearInstance();
     $project = ProjectManager::instance()->getProjectByUnixName('short-name');
     $this->assertEqual($project->getPublicName(), 'Long name');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:ProjectCreationTest.php

示例5: setUp

 public function setUp()
 {
     $this->old_cwd = getcwd();
     $this->system_command = new System_Command();
     parent::setUp();
     $this->old_sys_data_dir = isset($GLOBALS['sys_data_dir']) ? $GLOBALS['sys_data_dir'] : null;
     $GLOBALS['sys_data_dir'] = parent::getTmpDir();
     $GLOBALS['tmp_dir'] = dirname(__FILE__) . '/_fixtures/tmp';
     mkdir("{$GLOBALS['sys_data_dir']}/gitolite/admin/", 0777, true);
     mkdir("{$GLOBALS['sys_data_dir']}/gitolite/repositories/test_project", 0777, true);
     $sys_data_dir_arg = escapeshellarg($GLOBALS['sys_data_dir']);
     $this->system_command->exec("chmod -R 777 {$sys_data_dir_arg}/gitolite/repositories");
     ForgeConfig::store();
     $this->git_dao = new MyMockGitDao();
     $plugin_dao = mock('PluginDao');
     ProjectManager::clearInstance();
     $this->project_manager = ProjectManager::instance();
     $this->logger = mock('Logger');
     $this->git_plugin = new GitPlugin(1);
     $this->git_factory = new GitRepositoryFactory($this->git_dao, $this->project_manager);
     $this->git_systemeventmanager = mock('Git_SystemEventManager');
     $this->mirror_updater = mock('GitRepositoryMirrorUpdater');
     $this->mirror_data_mapper = mock('Git_Mirror_MirrorDataMapper');
     $this->git_manager = new GitRepositoryManager($this->git_factory, $this->git_systemeventmanager, $this->git_dao, parent::getTmpDir(), $this->mirror_updater, $this->mirror_data_mapper);
     $restricted_plugin_dao = mock('RestrictedPluginDao');
     $plugin_factory = new PluginFactory($plugin_dao, new PluginResourceRestrictor($restricted_plugin_dao));
     $plugin_manager = new PluginManager($plugin_factory, EventManager::instance(), new SiteCache($this->logger), new ForgeUpgradeConfig(new System_Command()));
     PluginManager::setInstance($plugin_manager);
     $this->ugroup_dao = mock('UGroupDao');
     $this->ugroup_manager = new UGroupManager($this->ugroup_dao, mock('EventManager'));
     $this->permission_dao = mock('PermissionsDAO');
     $permissions_manager = new PermissionsManager($this->permission_dao);
     $git_mirror_dao = mock('Git_Mirror_MirrorDao');
     $git_gitolite_driver = new Git_GitoliteDriver($this->logger, $this->git_systemeventmanager, mock('Git_GitRepositoryUrlManager'), $this->git_dao, $git_mirror_dao, $this->git_plugin, null, null, mock('Git_Gitolite_ConfigPermissionsSerializer'), null, null, mock('Git_Mirror_MirrorDataMapper'));
     $gitolite = new Git_Backend_Gitolite($git_gitolite_driver, $this->logger);
     $this->importer = new GitXmlImporter($this->logger, $this->git_manager, $this->git_factory, $gitolite, $this->git_systemeventmanager, $permissions_manager, $this->ugroup_manager);
     $this->temp_project_dir = parent::getTmpDir() . DIRECTORY_SEPARATOR . 'test_project';
     $userManager = mock('UserManager');
     stub($userManager)->getUserById()->returns(new PFUser());
     UserManager::setInstance($userManager);
     stub($this->permission_dao)->clearPermission()->returns(true);
     stub($this->permission_dao)->addPermission()->returns(true);
     stub($this->git_dao)->getProjectRepositoryList()->returns(array());
     copy(__DIR__ . '/_fixtures/stable_repo_one_commit.bundle', parent::getTmpDir() . DIRECTORY_SEPARATOR . 'stable.bundle');
     $this->project = $this->project_manager->getProjectFromDbRow(array('group_id' => 123, 'unix_group_name' => 'test_project', 'access' => Project::ACCESS_PUBLIC));
 }
开发者ID:blestab,项目名称:tuleap,代码行数:46,代码来源:GitXmlImporterTest.php

示例6: testImportProjectCreatesAProject

 public function testImportProjectCreatesAProject()
 {
     $project_manager = ProjectManager::instance();
     $user_manager = UserManager::instance();
     $importer = new ProjectXMLImporter(EventManager::instance(), $project_manager, new XML_RNGValidator(), new UGroupManager(), new XMLImportHelper($user_manager), new Log_ConsoleLogger());
     $xml_project = dirname(__FILE__) . '/_fixtures/fake_project.xml';
     $importer->import(null, $xml_project);
     // Reset Project Manager (and its cache)
     ProjectManager::clearInstance();
     $project_manager = ProjectManager::instance();
     // Check the project was created
     $project = $project_manager->getProjectByUnixName('toto123');
     $this->assertEqual($project->getPublicName(), 'Toto 123');
     $this->assertEqual($project->getDescription(), '123 Soleil');
     $this->assertEqual($project->usesSVN(), true);
     $this->assertEqual($project->usesCVS(), false);
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:17,代码来源:ProjectImportTest.php

示例7: testImportProjectCreatesAProject

 public function testImportProjectCreatesAProject()
 {
     $project_manager = ProjectManager::instance();
     $user_manager = UserManager::instance();
     $importer = new ProjectXMLImporter(EventManager::instance(), $project_manager, new XML_RNGValidator(), new UGroupManager(), new XMLImportHelper($user_manager), new Log_ConsoleLogger());
     $system_event_runner = mock('ProjectImportTest_SystemEventRunner');
     $archive = new Tuleap\Project\XML\Import\DirectoryArchive(__DIR__ . '/_fixtures/fake_project');
     $importer->importNewFromArchive($archive, $system_event_runner);
     // Reset Project Manager (and its cache)
     ProjectManager::clearInstance();
     $project_manager = ProjectManager::instance();
     // Check the project was created
     $project = $project_manager->getProjectByUnixName('toto123');
     $this->assertEqual($project->getPublicName(), 'Toto 123');
     $this->assertEqual($project->getDescription(), '123 Soleil');
     $this->assertEqual($project->usesSVN(), true);
     $this->assertEqual($project->usesCVS(), false);
     $system_event_runner->expectCallCount('runSystemEvents', 1);
     $system_event_runner->expectCallCount('checkPermissions', 1);
 }
开发者ID:ansarbek,项目名称:tuleap,代码行数:20,代码来源:ProjectImportTest.php


注:本文中的ProjectManager::clearInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。