本文整理汇总了PHP中PluginManager::SetInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManager::SetInstance方法的具体用法?PHP PluginManager::SetInstance怎么用?PHP PluginManager::SetInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager::SetInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup
public function setup()
{
parent::setup();
$this->plugin = $this->getMock('IPostReservationFactory');
$pluginManager = new FakePluginManager();
$pluginManager->postResPlugin = $this->plugin;
$this->service = $this->getMock('IReservationNotificationService');
PluginManager::SetInstance($pluginManager);
}
示例2: teardown
public function teardown()
{
$this->db = null;
$this->fakeServer = null;
Configuration::SetInstance(null);
PluginManager::SetInstance(null);
$this->fakeResources = null;
Date::_ResetNow();
}
示例3: testLoadsDeleteRulesFromPlugins
public function testLoadsDeleteRulesFromPlugins()
{
$preResPlugin = $this->getMock('IPreReservationFactory');
$pluginManager = new FakePluginManager();
$pluginManager->preResPlugin = $preResPlugin;
$validationService = $this->getMock('IReservationValidationService');
PluginManager::SetInstance($pluginManager);
$preResPlugin->expects($this->once())->method('CreatePreDeleteService')->with($this->fakeUser)->will($this->returnValue($validationService));
$reservationValidationFactory = new ReservationValidationFactory();
$actual = $reservationValidationFactory->Create(ReservationAction::Delete, $this->fakeUser);
$this->assertEquals($validationService, $actual);
}
示例4: setup
public function setup()
{
parent::setup();
PluginManager::SetInstance(null);
}