container = $this->prophesize(ContainerInterface::class); $cameraPictureManager = $this->prophesize(CameraPictureManagerService::class); $this->container->get(CameraPictureManagerService::class)->willReturn($cameraPictureManager); } /** * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ public function testFactory() { $factory = new ShowCameraImageFactory(); $this->assertInstanceOf(ShowCameraImageFactory::class, $factory); $showCameraImageAction = $factory($this->container->reveal()); $this->assertInstanceOf(ShowCameraImageAction::class, $showCameraImageAction); } }