new DateTime() can be used with insert-like commands, and with %? as well

This commit is contained in:
Sergey Tsalkov
2013-06-02 19:45:44 -07:00
parent e9a55de0b4
commit e61d66fdf8
2 changed files with 10 additions and 3 deletions

View File

@@ -142,7 +142,9 @@ class BasicTest extends SimpleTest {
}
function test_4_query() {
DB::query("UPDATE %b SET birthday=%t WHERE username=%s", 'accounts', new DateTime('10 September 2000 13:13:13'), 'Charlie\'s Friend');
DB::update('accounts', array(
'birthday' => new DateTime('10 September 2000 13:13:13')
), 'username=%s', 'Charlie\'s Friend');
$results = DB::query("SELECT * FROM accounts WHERE username=%s AND birthday IN %lt", 'Charlie\'s Friend', array('September 10 2000 13:13:13'));
$this->assert(count($results) === 1);