Ejemplo n.º 1
0
 /**
  * @param $ttvAttributes
  */
 public function create($ttvAttributes)
 {
     $newTaskType = new TaskType();
     $newTaskType->setType($ttvAttributes['type']);
     $newTaskType->setDescription($ttvAttributes['description']);
     $newTaskType->setClientId($ttvAttributes['client_id']);
     $newTaskType->save();
 }
Ejemplo n.º 2
0
 /**
  * updateRec() tests
  *  - attribute description changed.
  *
  * @test
  */
 public function POS_it_checks_updateRec_att_description_changed()
 {
     // create the record to check
     $description = 'was here';
     $taskType = new TaskType();
     $taskType->setType('Bob');
     $taskType->setDescription($description);
     $taskType->created_at = Carbon::now();
     $taskType->updated_at = Carbon::now();
     $taskType->client_id = 1;
     $taskType->save();
     // create the changed record
     $changeDescription = 'sorry bob is no longer here';
     $stdClass = new \stdClass();
     $stdClass->id = $taskType->id;
     $stdClass->type = $taskType->getType();
     $stdClass->desc = $changeDescription;
     $stdClass->client_id = $taskType->client_id;
     $taskType->updateRec($stdClass);
     $result = $taskType::where('id', $taskType->getId())->first();
     $this->assertEquals($result->getDescription(), $changeDescription);
 }