/**
  * ajax called method.
  */
 public function update()
 {
     $taskType = new TaskType();
     $taskType->updateRec(json_decode($_GET['data']));
 }
Example #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);
 }