Esempio n. 1
0
 /**
  * test deleting a Sport that does not exist
  */
 public function testDeleteValidSport()
 {
     // count the number of rows and save it for later
     $numRows = $this->getConnection()->getRowCount("sport");
     // create a new Sport and insert to into mySQL
     $sport = new Sport(null, $this->sport->getSportId(), $this->VALID_SPORT);
     $sport->insert($this->getPDO());
     // Delete this Sport from mySQL
     $sport->assertEquals($numRows + 1, $this->getConnection()->getRowCount("sport"));
     $sport->delete($this->getPDO());
     // grab the data from mySQL and enforce the fields match our expectations
     $pdoSport = Sport::getSportBySportId($this->getPDO(), $sport->getSportId());
     $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount("sport"));
     $this->assertEquals($pdoSport->getSportId(), $this->sport->getSportId());
 }