コード例 #1
0
 /**
  * Handles POST requests for /project/{project_id}/delete
  *
  * @return redirect
  */
 public function postProjectDelete($project_id)
 {
     $deleteTypesTables = ProjectType::deleteAllTypesTables($project_id);
     if ($deleteTypesTables) {
         ProjectType::where('project_id', $project_id)->delete();
         Project::where('id', $project_id)->delete();
         return Redirect::back()->with(['error' => false, 'message' => 'Project deleted successfully.']);
     } else {
         return Redirect::back()->with(['error' => true, 'message' => 'Error delete all type sets.']);
     }
 }
コード例 #2
0
ファイル: ProjectTypeTest.php プロジェクト: shampine/plumage
 /**
  * ProjectType::deleteAllTypesTables()
  *
  */
 public function testDeleteAllTypesTablesTrue()
 {
     $this->setVars();
     $response = ProjectType::deleteAllTypesTables($this->project->id);
     $this->assertEquals(true, $response);
 }