/** * Handles POST requests for /project/{project_id} * * @return redirect */ public function postProject($project_id) { if (!$this->checkNaming($this->input['table_name'])) { $response = ['error' => true, 'message' => 'Types may only contain lowercase a-z, underscores, & dashes.']; } else { ProjectType::createTypesGroup($project_id, $this->input['table_name']); $response = ['error' => false, 'message' => 'Created project type successfully.']; } return Redirect::back()->with($response); }
/** * ProjectType::createTypesGroup() * * @expectedException Exception */ public function testCreateTypesGroupException() { $this->setVars(); ProjectType::createTypesGroup(83838, 'failure'); }