function it_postLoad_should_configure_only_active_plugin(GenericEvent $event, ContainerInterface $container, PluginInterface $active, PluginInterface $inactive) { $container->getByPrefix('plugins')->shouldBeCalled()->willReturn(array($active, $inactive)); $active->getTitle()->shouldBeCalled()->willReturn('Some'); $active->isActive()->willReturn(true); $active->configure()->shouldBeCalled(); $inactive->isActive()->willReturn(false); $inactive->configure()->shouldNotBeCalled(); $this->postLoad($event); }
function it_plugin_should_not_runAll_if_not_active(ContainerInterface $container, PluginInterface $active, PluginInterface $inactive, GenericEvent $event) { $event->getSubject()->willReturn($container); $event->getArgument('plugin')->willReturn(null); $event->addProcessEvent(Argument::any())->shouldBeCalled(); $container->getByPrefix('plugins')->willReturn(array($active, $inactive)); $container->has('active')->willReturn(true); $active->isActive()->shouldBeCalled()->willReturn(true); $active->runAll()->willReturn(new ProcessEvent($active->getWrappedObject(), array())); $active->getTitle()->willReturn('active'); $container->has('inactive')->willReturn(true); $inactive->getName()->willReturn('inactive'); $inactive->getTitle()->willReturn('Inactive'); $inactive->isActive()->shouldBeCalled()->willReturn(false); $inactive->runAll(Argument::any())->shouldNotBeCalled(); $this->runAllCommand($event); }