prophesize('PHPCI\Store\BuildStore'); $projectStore = $this->prophesize('PHPCI\Store\ProjectStore'); $project = new Project(); $project->setAllowPublicStatus(false); $projectStore->getById(Argument::any())->willReturn($project); $webController = new BuildStatusController( $this->prophesize('PHPCI\Config')->reveal(), $this->prophesize('b8\Http\Request')->reveal(), new \b8\Http\Response(), $buildStore->reveal(), $projectStore->reveal() ); $result = $webController->handleAction('ccxml', [1]); } public function test_ccxml_visible_for_public_project() { $buildStore = $this->prophesize('PHPCI\Store\BuildStore'); $projectStore = $this->prophesize('PHPCI\Store\ProjectStore'); $project = new Project(); $project->setId(1); $project->setBranch('test'); $project->setAllowPublicStatus(true); $projectStore->getById(1)->willReturn($project); $webController = new BuildStatusController( $this->prophesize('PHPCI\Config')->reveal(), $this->prophesize('b8\Http\Request')->reveal(), new \b8\Http\Response(), $buildStore->reveal(), $projectStore->reveal() ); $result = $webController->handleAction('ccxml', [1]); $this->assertInstanceOf('b8\Http\Response', $result); $responseData = $result->getData(); $this->assertEquals('text/xml', $responseData['headers']['Content-Type']); $this->assertXmlStringEqualsXmlString('', $responseData['body']); } }