Пример #1
0
 /**
  * Test test "normalizePercentTimeTo100Percent()" in Assignments.class.inc.
  */
 public function testupdateTaStartRec()
 {
     // Objective: Create a db entry and then update it and test for
     // the update.
     // $log_file =
     // fopen("/var/www/html/jimfuqua/tutorW/logs/testupdateTaStartRec.log",
     // "w");
     // the lessons inserted do not have tA_PercentTime  error is in the insert
     // $v = var_export($student_assignments_array, true);
     // $string = __LINE__.' $student_assignments_array = '.$v."\n\n";
     // fwrite($log_file, $string).
     $this->resetMyArray();
     // Reset myArray to origninal values.
     // 987654000.
     $this->myArray['tA_OriginalTimestamp'] = '0987654';
     $this->myArray['tA_S_ID'] = 'x!@#$1112';
     $this->myArray['tA_StartRec'] = 22;
     $ac_class_instance = new AssignmentsClass();
     $result1 = $ac_class_instance->insertRecord($this->myArray);
     $this->assertTrue($result1 === 1);
     $result2 = $ac_class_instance->updateTaStartRec(44, $this->myArray['tA_S_ID'], $this->myArray['tA_OriginalTimestamp']);
     // $string = __LINE__.' $result2 = '.$result2."\n\n";
     // fwrite($log_file, $string);.
     $this->assertTrue($result2 === 1);
     // mysql_affected_rows
     // Get the row and check the results.
     $ac_class_instance = new AssignmentsClass();
     $result3 = $ac_class_instance->getNewestDbEntry('x!@#$1112');
     $this->assertTrue($result3['tA_StartRec'] == '44');
     // Now delete the rows.
     $ac_class_instance->delRowsByStudentId('x!@#$1112');
     $ac_class_instance->delRowsByStudentId('!@#$1112');
     // Clean Up.
     $ac_class_instance->delRowsByStudentId($this->myArray['tA_S_ID']);
     $ac_class_instance->delRowsByStudentId('x!@#$1112');
     $this->resetMyArray();
     // reset myArray to origninal values.
 }