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


PHP EventManager::setInstance方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     EventManager::setInstance(mock('EventManager'));
     $this->rm = partial_mock('ReferenceManager', array('_getReferenceDao', '_getCrossReferenceDao', 'loadReservedKeywords', 'getGroupIdFromArtifactIdForCallbackFunction', 'getGroupIdFromArtifactId'));
     $this->rm->__construct();
 }
开发者ID:nterray,项目名称:tuleap,代码行数:7,代码来源:ReferenceManagerTest.php

示例2: itRedirectToTheCurrentMilestoneCardwallIfAny

 function itRedirectToTheCurrentMilestoneCardwallIfAny()
 {
     $event_manager = mock('EventManager');
     EventManager::setInstance($event_manager);
     $event_manager->expectOnce('processEvent', array(AGILEDASHBOARD_EVENT_MILESTONE_SELECTOR_REDIRECT, '*'));
     $controller = new Planning_MilestoneSelectorController($this->request, $this->milestone_factory);
     $controller->show();
 }
开发者ID:nterray,项目名称:tuleap,代码行数:8,代码来源:MilestoneSelectorControllerTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $this->event_manager = mock('EventManager');
     EventManager::setInstance($this->event_manager);
     $this->tracker = mock('Tracker');
     $this->artifact_factory = mock('Tracker_ArtifactFactory');
     $this->tracker_factory = mock('TrackerFactory');
     $this->formelement_factory = mock('Tracker_FormElementFactory');
     $this->action = new Tracker_Action_CreateArtifact_ProtectedToPublic($this->tracker, $this->artifact_factory, $this->tracker_factory, $this->formelement_factory);
 }
开发者ID:nterray,项目名称:tuleap,代码行数:11,代码来源:CreateArtifactTest.php

示例4: setUp

 public function setUp()
 {
     $package_factory = new FRSPackageFactoryMock();
     $release_factory = new FRSReleaseFactory();
     $file_factory = new FRSXMLImporterTest_FRSFileFactory();
     $this->package_dao = mock('FRSPackageDao');
     $package_factory->dao = $this->package_dao;
     FRSPackageFactory::setInstance($package_factory);
     $this->permissions_manager = mock('PermissionsManager');
     PermissionsManager::setInstance($this->permissions_manager);
     $this->release_dao = mock('FRSReleaseDao');
     $release_factory->dao = $this->release_dao;
     $release_factory->package_factory = $package_factory;
     $release_factory->file_factory = $file_factory;
     FRSReleaseFactory::setInstance($release_factory);
     $this->file_dao = mock('FRSFileDao');
     $file_factory->dao = $this->file_dao;
     $file_factory->release_factory = $release_factory;
     $this->processor_dao = mock('FRSProcessorDao');
     $this->filetype_dao = mock('FRSFileTypeDao');
     $this->user_finder = mock('User\\XML\\Import\\IFindUserFromXMLReference');
     $this->user_manager = mock('UserManager');
     UserManager::setInstance($this->user_manager);
     $this->ugroup_dao = mock("UGroupDao");
     stub($this->ugroup_dao)->searchByGroupIdAndName()->returns(new DataAccessResultEmpty());
     $this->frs_importer = new FRSXMLImporter(mock('Logger'), new XML_RNGValidator(), $package_factory, $release_factory, $file_factory, $this->user_finder, new UGroupManager($this->ugroup_dao), $this->processor_dao, $this->filetype_dao);
     EventManager::setInstance(mock('EventManager'));
     $GLOBALS['Language'] = mock('BaseLanguage');
     if (isset($GLOBALS['ftp_incoming_dir'])) {
         $this->old_ftp_incoming_dir = $GLOBALS['ftp_incoming_dir'];
     }
     if (isset($GLOBALS['old_ftp_frs_dir_prefix'])) {
         $this->old_ftp_frs_dir_prefix = $GLOBALS['ftp_frs_dir_prefix'];
     }
     $GLOBALS['ftp_incoming_dir'] = parent::getTmpDir();
     $GLOBALS['ftp_frs_dir_prefix'] = parent::getTmpDir();
 }
开发者ID:blestab,项目名称:tuleap,代码行数:37,代码来源:FRSXMLImporterTest.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     $event_manager = new EventManager();
     $event_manager->addListener(Event::GET_LDAP_LOGIN_NAME_FOR_USER, $this, 'hookReturnsLdapUser', false, 0);
     EventManager::setInstance($event_manager);
     $this->ldap_login = 'bla blo';
     $this->ldap_result = stub('LDAPResult')->getLogin()->returns($this->ldap_login);
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:9,代码来源:UserAccountManagerTest.php

示例6: itPassUserByReference

    public function itPassUserByReference() {
        $user_row = array('user_id' => 90);

        $event_manager = new EventManager();
        $event_manager->addListener(Event::USER_MANAGER_GET_USER_INSTANCE, $this, 'mockedMethodForEventTest', false, 0);
        EventManager::setInstance($event_manager);
        $result_expected = 'thatValue';

        $result = $this->user_manager->getUserInstanceFromRow($user_row);
        $this->assertEqual($result, $result_expected);
    }
开发者ID:rinodung,项目名称:tuleap,代码行数:11,代码来源:UserManagerTest.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     $this->event_manager = new MockEventManager_GetTypesForQueue();
     EventManager::setInstance($this->event_manager);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:6,代码来源:SystemEventManagerTest.php


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