Exemple #1
0
 /**
  * Test test "normalizePercentTimeTo100Percent()" in Assignments.class.inc
  *
  * A *description*, that can span multiple lines, to go _in-depth_ into the details of this element
  * and to provide some background information or textual references.
  *
  * @return void
  */
 public function testdeleteLastRow()
 {
     $this->testbuildArray();
     // reset myArray to origninal values.
     $classInstance = new tutor\src\classes\AssignmentsClass();
     $this->assertTrue(isset($classInstance));
     // start clean
     $classInstance->delRowsByStudentId($this->myArray['tA_S_ID']);
     $classInstance->delRowsByStudentId('777777');
     $this->myArray['tA_S_ID'] = 777777;
     $result = $classInstance->insertRecord($this->myArray);
     $result = $classInstance->insertRecord($this->myArray);
     $result = $classInstance->insertRecord($this->myArray);
     $phpTime = time();
     $resultsArray = $classInstance->getCurrentStudentAssignmentsInAnArray($this->myArray['tA_S_ID']);
     $resultsArrayCount = count($resultsArray);
     $this->assertTrue($resultsArrayCount === 3);
     $result = $classInstance->deleteLastRow($this->myArray['tA_S_ID']);
     $this->assertTrue($result === 1);
     $resultsArray = $classInstance->getCurrentStudentAssignmentsInAnArray($this->myArray['tA_S_ID']);
     $this->assertTrue(count($resultsArray) === 2);
     $classInstance->delRowsByStudentId($this->myArray['tA_S_ID']);
     $classInstance->delRowsByStudentId('777777');
 }