コード例 #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);
     }
 }
コード例 #2
0
 /**
  * @depends testExecute
  */
 public function testTruncate()
 {
     $this->db->truncate('users');
     $this->db->truncate(array('users'));
     $this->assertEquals(0, $this->db->getNumRows('SELECT id FROM users'));
 }
コード例 #3
0
 /**
  * @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)));
 }