/** * 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 testdeleteRowByRowId() { $this->testbuildArray(); // reset myArray to origninal values. $classInstance = new tutor\src\classes\AssignmentsClass(); $result = $classInstance->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 = $classInstance->insertRecord($this->myArray); // This inserts data into array but does not have a remaining value. $this->assertTrue(isset($classInstance)); $this->assertTrue($result === 1); $row = $classInstance->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 = $classInstance->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->testbuildArray(); // reset myArray to original values. // Clean Up $classInstance->delRowsByStudentId($this->myArray['tA_S_ID']); }