container = $this->prophesize(ContainerInterface::class); $ciExecutorService = $this->prophesize(CiExecutorService::class); $this->container->get(CiExecutorService::class)->willReturn($ciExecutorService); } public function testFactory() { $factory = new JcatPackageFactory(); $this->assertTrue($factory instanceof JcatPackageFactory); $actionPage = $factory($this->container->reveal()); $this->assertTrue($actionPage instanceof JcatPackageAction); } }