Example #1
0
 public function testExecuteQueryScalar()
 {
     $db = new Database(static::getDefaultDatabaseConfig());
     $result = $db->executeScalar("select count(*) from pg_database where datname='postgres'");
     $this->assertEquals(1, $result);
 }
Example #2
0
 /**
  * Retuns the count of all records in the relation
  * @return integer
  */
 protected function countAll()
 {
     $sql = 'SELECT COUNT(true) FROM ' . $this->relation;
     return $this->database->executeScalar($sql);
 }