/** * @todo Implement testDeleteProperties(). */ public function testDeleteProperties() { mysql_query("TRUNCATE TABLE `hs_hr_comp_property`", $this->connection); mysql_query("INSERT INTO `hs_hr_comp_property` (`prop_name`,`emp_id`) VALUES ('new Item','1')", $this->connection); mysql_query("INSERT INTO `hs_hr_comp_property` (`prop_name`,`emp_id`) VALUES ('new Item 2','10')", $this->connection); mysql_query("INSERT INTO `hs_hr_comp_property` (`prop_name`,`emp_id`) VALUES ('new Item 3','11')", $this->connection); mysql_query("INSERT INTO `hs_hr_comp_property` (`prop_name`,`emp_id`) VALUES ('new Item 5','20')", $this->connection); $prop = new CompProperty(); $prop->setDeleteList(array('2', '3')); $prop->deleteProperties(); $res = mysql_query("SELECT * FROM `hs_hr_comp_property`", $this->connection); $numRows = mysql_num_rows($res); $this->assertEquals($numRows, 2, 'Number of rows invalid'); $row = mysql_fetch_array($res); $this->assertEquals($row['prop_name'], 'new Item'); $this->assertEquals($row['emp_id'], '1'); $this->assertEquals($row['prop_id'], '1'); $row = mysql_fetch_array($res); $this->assertEquals($row['prop_name'], 'new Item 5'); $this->assertEquals($row['emp_id'], '20'); $this->assertEquals($row['prop_id'], '4'); }