Fix get-where tests
This commit is contained in:
parent
6b6660585c
commit
c61df13fbc
@ -138,6 +138,8 @@ class Query_Builder {
|
|||||||
// Quote the identifiers
|
// Quote the identifiers
|
||||||
$safe_array = array_map(array($this->db, 'quote_ident'), $fields_array);
|
$safe_array = array_map(array($this->db, 'quote_ident'), $fields_array);
|
||||||
|
|
||||||
|
unset($fields_array);
|
||||||
|
|
||||||
// Join the strings back together
|
// Join the strings back together
|
||||||
for($i = 0, $c = count($safe_array); $i < $c; $i++)
|
for($i = 0, $c = count($safe_array); $i < $c; $i++)
|
||||||
{
|
{
|
||||||
@ -149,7 +151,7 @@ class Query_Builder {
|
|||||||
|
|
||||||
$this->select_string = implode(', ', $safe_array);
|
$this->select_string = implode(', ', $safe_array);
|
||||||
|
|
||||||
//echo $this->select_string."<br />";
|
unset($safe_array);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -208,7 +210,9 @@ class Query_Builder {
|
|||||||
// Create the where portion of the string
|
// Create the where portion of the string
|
||||||
$this->where_string = ' WHERE '.implode(', ', $kv_array);
|
$this->where_string = ' WHERE '.implode(', ', $kv_array);
|
||||||
|
|
||||||
// @todo Implement where method
|
unset($kv_array);
|
||||||
|
unset($fields);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,6 +154,21 @@ class FirebirdTest extends UnitTestCase {
|
|||||||
$this->assertTrue(is_resource($query));
|
$this->assertTrue(is_resource($query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function TestQBSelectWhereGet()
|
||||||
|
{
|
||||||
|
$query = $this->qb->select('id, key as k, val')->where('id >', 1)->get('create_test', 2, 1);
|
||||||
|
|
||||||
|
$this->assertTrue(is_resource($query));
|
||||||
|
}
|
||||||
|
|
||||||
|
function TestQBSelectWhereGet2()
|
||||||
|
{
|
||||||
|
$query = $this->qb->select('id, key as k, val')->where(' id ', 1)->get('create_test', 2, 1);
|
||||||
|
|
||||||
|
$this->assertTrue(is_resource($query));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function TestQBSelectGet()
|
function TestQBSelectGet()
|
||||||
{
|
{
|
||||||
$query = $this->qb->select('id, key as k, val')->get('create_test', 2, 1);
|
$query = $this->qb->select('id, key as k, val')->get('create_test', 2, 1);
|
||||||
|
@ -154,7 +154,14 @@ SQL;
|
|||||||
|
|
||||||
function TestQBSelectWhereGet()
|
function TestQBSelectWhereGet()
|
||||||
{
|
{
|
||||||
$query = $this->qb->select('id, key as k, val')->where('id >', 1)->get('create_test, 2, 1');
|
$query = $this->qb->select('id, key as k, val')->where('id >', 1)->get('create_test', 2, 1);
|
||||||
|
|
||||||
|
$this->assertIsA($query, 'PDOStatement');
|
||||||
|
}
|
||||||
|
|
||||||
|
function TestQBSelectWhereGet2()
|
||||||
|
{
|
||||||
|
$query = $this->qb->select('id, key as k, val')->where('id', 1)->get('create_test', 2, 1);
|
||||||
|
|
||||||
$this->assertIsA($query, 'PDOStatement');
|
$this->assertIsA($query, 'PDOStatement');
|
||||||
}
|
}
|
||||||
@ -179,7 +186,7 @@ SQL;
|
|||||||
|
|
||||||
//Check
|
//Check
|
||||||
$dbs = $this->db->get_tables();
|
$dbs = $this->db->get_tables();
|
||||||
$this->assertTrue(empty($dbs['create_test']));
|
$this->assertFalse(in_array('create_test', $dbs));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Binary file not shown.
Reference in New Issue
Block a user