Query builder delete tests
This commit is contained in:
parent
57fa7a5177
commit
f83e93541c
@ -508,7 +508,10 @@ class Query_Builder {
|
||||
public function delete($table, $where='')
|
||||
{
|
||||
// Set the where clause
|
||||
if ( ! empty($where))
|
||||
{
|
||||
$this->where($where);
|
||||
}
|
||||
|
||||
// Create the SQL and parameters
|
||||
$sql = $this->_compile("delete", $table);
|
||||
@ -618,7 +621,7 @@ class Query_Builder {
|
||||
break;
|
||||
}
|
||||
|
||||
//echo $sql.'<br />';
|
||||
echo $sql.'<br />';
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class FirebirdQBTest extends UnitTestCase {
|
||||
$params->pass = 'masterkey';
|
||||
$this->qb = new Query_Builder($params);
|
||||
|
||||
//echo '<hr /> Firebird Queries <br />';
|
||||
echo '<hr /> Firebird Queries <hr />';
|
||||
}
|
||||
|
||||
function TestQBGet()
|
||||
@ -126,4 +126,11 @@ class FirebirdQBTest extends UnitTestCase {
|
||||
|
||||
$this->assertTrue($query);
|
||||
}
|
||||
|
||||
function TestDelete()
|
||||
{
|
||||
$query = $this->qb->where('id', 4)->delete('create_test');
|
||||
|
||||
$this->assertTrue($query);
|
||||
}
|
||||
}
|
@ -28,7 +28,7 @@
|
||||
$params->host = 'localhost';
|
||||
$this->qb = new Query_Builder($params);
|
||||
|
||||
//echo '<hr /> SQLite Queries <br />';
|
||||
echo '<hr /> SQLite Queries <hr />';
|
||||
}
|
||||
|
||||
function TestGet()
|
||||
@ -120,4 +120,11 @@
|
||||
|
||||
$this->assertIsA($query, 'PDOStatement');
|
||||
}
|
||||
|
||||
function TestDelete()
|
||||
{
|
||||
$query = $this->qb->where('id', 4)->delete('create_test');
|
||||
|
||||
$this->assertIsA($query, 'PDOStatement');
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user