public function it_applies_rule(RuleInterface $rule, Article $subject, RouteProviderInterface $routeProvider, RouteInterface $route, LoggerInterface $logger, ArticleServiceInterface $articleService) { $rule->getConfiguration()->willReturn(['route' => 'some/route', 'templateName' => 'template.twig.html', 'published' => 'true']); $rule->getExpression()->willReturn('article.getSomething("something") matches /something/'); $routeProvider->getOneById('some/route')->willReturn($route); $subject->setRoute($route)->shouldBeCalled(); $subject->setTemplateName('template.twig.html')->shouldBeCalled(); $articleService->publish($subject)->shouldBeCalled(); $logger->info(Argument::any('string'))->shouldBeCalled(); $this->apply($rule, $subject)->shouldReturn(null); }