Query builder firebird tests
This commit is contained in:
parent
5e9bd131d1
commit
1cbfb0a0e3
@ -18,7 +18,7 @@
|
||||
*/
|
||||
class Query_Builder {
|
||||
|
||||
private $table;
|
||||
private $table, $where_array;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -107,10 +107,19 @@ class Query_Builder {
|
||||
*/
|
||||
public function get($table='', $limit=FALSE, $offset=FALSE)
|
||||
{
|
||||
$sql = 'SELECT * FROM ' . $this->quote_ident($table);
|
||||
|
||||
if ( ! empty($table) && $limit === FALSE && $offset === FALSE)
|
||||
{
|
||||
return $this->query('SELECT * FROM ' . $this->quote_ident($table));
|
||||
$result = $this->query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->query($this->sql->limit($sql, $limit, $offset));
|
||||
}
|
||||
|
||||
// For the firebird class, return $this so you can act on the result
|
||||
return (is_resource($result)) ? $this : $result;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
@ -33,7 +33,19 @@ class FirebirdTest extends UnitTestCase {
|
||||
function setUp()
|
||||
{
|
||||
$dbpath = TEST_DIR.DS.'test_dbs'.DS.'FB_TEST_DB.FDB';
|
||||
|
||||
// Test the db driver directly
|
||||
$this->db = new Firebird('localhost:'.$dbpath);
|
||||
|
||||
// Test the query builder
|
||||
$params = new Stdclass();
|
||||
$params->type = 'firebird';
|
||||
$params->file = $dbpath;
|
||||
$params->host = 'localhost';
|
||||
$params->user = 'sysdba';
|
||||
$params->pass = 'masterkey';
|
||||
$this->qb = new Query_Builder($params);
|
||||
|
||||
$this->tables = $this->db->get_tables();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user