public function creating(TaskType $taskType) { // check if getTestRDBMS is set for testing the Database triggers. if (appGlobals()->getTestRDBMS()) { // this log statement is needed to make testCreatingDataThatAlreadyExists() pass in // TaskTypeView/testTaskTypeRDBMS.php; this is a mystery as to why... MyLog()->info("I was creating", ['taskType' => $taskType]); return true; } $result = $taskType->checkTaskTypeCreateAudits($taskType); if ($result > 0) { session()->forget(appGlobals()->getInfoMessageType()); session()->flash(appGlobals()->getInfoMessageType(), appGlobals()->getInfoMessageText($result)); return false; } return true; }
/** * audit test * - check checkIfTypeContainsMultipleWords() -- return appGlobals()::TBL_TASK_TYPE_TYPE_RESTRICTED_TO_ONE_WORD * * @test */ public function NEG_it_checks_create_audits_checking_checkIfTypeContainsMultipleWords() { $type = 'Bob is not here'; $taskType = new TaskType(); $taskType->setType($type); $taskType->setDescription('was here'); $taskType->created_at = Carbon::now(); $taskType->updated_at = Carbon::now(); $taskType->client_id = 1; $result = $taskType->checkTaskTypeCreateAudits($taskType); $this->assertEquals($result, appGlobals()::TBL_TASK_TYPE_TYPE_RESTRICTED_TO_ONE_WORD); }