File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
tests/system/Database/Live Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1414namespace CodeIgniter \Database \Live ;
1515
1616use CodeIgniter \Database \RawSql ;
17+ use CodeIgniter \I18n \Time ;
1718use CodeIgniter \Test \CIUnitTestCase ;
1819use CodeIgniter \Test \DatabaseTestTrait ;
1920
@@ -54,6 +55,14 @@ public function testEscape(): void
5455 $ this ->assertSame ($ expected , $ sql );
5556 }
5657
58+ public function testEscapeStringable (): void
59+ {
60+ $ expected = "SELECT * FROM brands WHERE name = '2024-01-01 12:00:00' " ;
61+ $ sql = 'SELECT * FROM brands WHERE name = ' . $ this ->db ->escape (new Time ('2024-01-01 12:00:00 ' ));
62+
63+ $ this ->assertSame ($ expected , $ sql );
64+ }
65+
5766 public function testEscapeString (): void
5867 {
5968 $ expected = "SELECT * FROM brands WHERE name = 'O " . $ this ->char . "'Doules' " ;
You can’t perform that action at this time.
0 commit comments