Пример #1
0
 /**
  * Test test "normalizePercentTimeTo100Percent()" in Assignments.class.inc.
  */
 public function testdeleteRowByRowId()
 {
     $this->resetMyArray();
     // Reset myArray to origninal values.
     $ac_class_instance = new AssignmentsClass();
     $result = $ac_class_instance->delRowsByStudentId($this->myArray['tA_S_ID']);
     // Remove rows if they exist.
     // $this->assertTrue( mysql_affected_rows() === 0);
     // $this->assertTrue( $mysqli->affected_rows === 0);
     // No rows should have been there to delete.
     $result = $ac_class_instance->insertRecord($this->myArray);
     // This inserts data into array but does not have a remaining value.
     $this->assertTrue(isset($ac_class_instance));
     $this->assertTrue($result === 1);
     $row = $ac_class_instance->getLastDbEntryAsArray($this->myArray['tA_S_ID']);
     // $this->assertTrue( is_resource($result));
     // $row = mysql_fetch_array($result, MYSQL_ASSOC);
     // $row = $result->fetch_array(MYSQLI_BOTH);
     $this->assertTrue(is_array($row));
     $result = $ac_class_instance->deleteRowByRowId($row['tA_id']);
     // $this->assertTrue( mysql_affected_rows() === 1);
     // $this->assertTrue( $mysqli->affected_rows === 1);
     // Only one row should have been there to delete.
     $this->resetMyArray();
     // Reset myArray to original values.
     // Clean Up.
     $ac_class_instance->delRowsByStudentId($this->myArray['tA_S_ID']);
     $this->resetMyArray();
 }