container = $this->prophesize(ContainerInterface::class); $router = $this->prophesize(RouterInterface::class); $templateRenderer = $this->prophesize(TemplateRendererInterface::class); $this->container->get(TemplateRendererInterface::class)->willReturn($templateRenderer); $this->container->get(RouterInterface::class)->willReturn($router); $this->container->get("config")->willReturn(['application'=>[]]); } /** * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ public function testFactory() { $factory = new HomePageFactory(); $this->assertInstanceOf(HomePageFactory::class, $factory); $homePage = $factory($this->container->reveal()); $this->assertInstanceOf(HomePageAction::class, $homePage); } }