Exemplo n.º 1
0
 /**
  * Delete a project.
  */
 public function delete($projectId)
 {
     $this->requireAdmin();
     $project = $this->projectStore->getById($projectId);
     $this->projectService->deleteProject($project);
     header('Location: ' . PHPCI_URL);
     exit;
 }
Exemplo n.º 2
0
 /**
  * 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;
 }
Exemplo n.º 3
0
 /**
  * @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));
 }