/** * 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.']); } }
/** * ProjectType::deleteAllTypesTables() * */ public function testDeleteAllTypesTablesTrue() { $this->setVars(); $response = ProjectType::deleteAllTypesTables($this->project->id); $this->assertEquals(true, $response); }