public function testExecuteQueryScalar() { $db = new Database(static::getDefaultDatabaseConfig()); $result = $db->executeScalar("select count(*) from pg_database where datname='postgres'"); $this->assertEquals(1, $result); }
/** * 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); }