/** * Delete a project. */ public function delete($projectId) { $this->requireAdmin(); $project = $this->projectStore->getById($projectId); $this->projectService->deleteProject($project); header('Location: ' . PHPCI_URL); exit; }
/** * Delete a project. */ public function delete($projectId) { $this->requireAdmin(); $project = $this->projectStore->getById($projectId); $this->projectService->deleteProject($project); $response = new b8\Http\Response\RedirectResponse(); $response->setHeader('Location', PHPCI_URL); return $response; }
/** * @covers PHPUnit::execute */ public function testExecute_DeleteProject() { $store = $this->getMock('PHPCI\\Store\\ProjectStore'); $store->expects($this->once())->method('delete')->will($this->returnValue(true)); $service = new ProjectService($store); $project = new Project(); $this->assertEquals(true, $service->deleteProject($project)); }