function testdeleteRowId() { // This should have no effect on the database and does not insert a row that is not removed. $result = $this->testbuildArray(); // reset myArray to origninal values. $classInstance = new SplitsClass(); $this->assertTrue(isset($classInstance)); $result = $classInstance->deleteSplitLessonName('split_name'); $result = $classInstance->deleteRowId($this->myArray['tSp_id']); $this->assertTrue($result === false); // If true improper cleanup. $result = $classInstance->insertRow($this->myArray); // true on success. $this->assertTrue($result === 1); // 'tSp_id' is assigned with each entry. Must retrieve. $LastDbEntryAsArray = $classInstance->getLastDbEntryAsArray(); $result = $classInstance->deleteRowId($LastDbEntryAsArray['tSp_id']); $this->assertTrue($result === 1); // affected rows $result = $classInstance->insertRow($this->myArray); $result = $classInstance->deleteRowId('not a number'); $this->assertTrue($result === false); // $id must be a number. $result = $classInstance->deleteRowId(null); $this->assertTrue($result === false); // $id must be a number. $result = $classInstance->insertRow($this->myArray); // true on success. $this->assertTrue($result === 1); $result = $classInstance->getLastDbEntryAsArray(); // Now test for $result containing accurate data. $this->assertTrue($result['tSp_LessonName'] === 'telling_time'); $result = $classInstance->deleteRowId($result['tSp_id']); $this->assertTrue($result === 1); // affected rows. // Clean Up $result = $classInstance->deleteSplitLessonName($this->myArray['tSp_LessonName']); }