示例#1
0
 /**
  * Set the number of results.
  */
 private function setNumResults()
 {
     // based on resultsQuery
     if ($this->numResultsQuery != '') {
         $this->numResults = (int) $this->db->getVar($this->numResultsQuery, $this->numResultsQueryParameters);
     } else {
         $this->numResults = (int) $this->db->getNumRows($this->query, $this->queryParameters);
     }
 }
 /**
  * @depends testExecute
  */
 public function testTruncate()
 {
     $this->db->truncate('users');
     $this->db->truncate(array('users'));
     $this->assertEquals(0, $this->db->getNumRows('SELECT id FROM users'));
 }
 /**
  * @throws SpoonDatabaseException
  */
 public function testGetNumRows()
 {
     $this->assertEquals(self::NUMBER_OF_ROWS, $this->db->getNumRows('SELECT id FROM users'));
     $this->assertEquals(10000, $this->db->getNumRows('SELECT id FROM users LIMIT ?', array(10000)));
 }