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);
 }
Exemplo n.º 2
0
 function it_plugin_should_not_run_if_not_active(ContainerInterface $container, PluginInterface $active, PluginInterface $inactive, EvaluateEvent $event)
 {
     $container->getByPrefix('plugins')->willReturn(array($active, $inactive));
     $active->isActive()->shouldBeCalled()->willReturn(true);
     $active->getMatchedFiles($event)->willReturn(array('some_file'));
     $active->run(Argument::any())->shouldBeCalled();
     $inactive->isActive()->shouldBeCalled()->willReturn(false);
     $inactive->run(Argument::any())->shouldNotBeCalled();
     $this->evaluate($event);
 }