ciExecutorService = $this->prophesize(CiExecutorService::class); $this->ciExecutorService->getJcatPackages()->willReturn($this->testJcatVersions); } public function testResponse() { $ciConfigPage = new JcatPackageAction($this->ciExecutorService->reveal()); $response = $ciConfigPage(new ServerRequest(), new Response(), function () { }); $this->assertTrue($response instanceof Response); } public function testGetList() { $ciConfigPage = new JcatPackageAction($this->ciExecutorService->reveal()); $response = $ciConfigPage(new ServerRequest(), new Response(), function () { }); $this->assertTrue($response instanceof JsonCorsResponse); $json = json_decode((string) $response->getBody()); $this->assertTrue(is_array($json)); $this->assertTrue($json == $this->testJcatVersions); } }