@@ -269,7 +269,7 @@ public function testNamedBinds()
269
269
/**
270
270
* @see https://github.com/codeigniter4/CodeIgniter4/issues/3566
271
271
*/
272
- public function testNamedBindsWithColonElseWhere ()
272
+ public function testNamedBindsWithColonElsewhere ()
273
273
{
274
274
$ query = new Query ($ this ->db );
275
275
$ query ->setQuery ('SELECT `email`, @total:=(total+1) FROM `users` WHERE `id` = :id: ' , ['id ' => 10 ]);
@@ -278,6 +278,30 @@ public function testNamedBindsWithColonElseWhere()
278
278
$ this ->assertSame ($ sql , $ query ->getQuery ());
279
279
}
280
280
281
+ /**
282
+ * @see https://github.com/codeigniter4/CodeIgniter4/pull/5138
283
+ */
284
+ public function testNamedBindsWithBindMarkerElsewhere ()
285
+ {
286
+ $ query = new Query ($ this ->db );
287
+ $ query ->setQuery ('SELECT * FROM posts WHERE id = :id: AND title = \'The default bind marker is "?" \'' , ['id ' => 10 ]);
288
+
289
+ $ sql = 'SELECT * FROM posts WHERE id = 10 AND title = \'The default bind marker is "?" \'' ;
290
+ $ this ->assertSame ($ sql , $ query ->getQuery ());
291
+ }
292
+
293
+ /**
294
+ * @see https://github.com/codeigniter4/CodeIgniter4/pull/5138
295
+ */
296
+ public function testSimpleBindsWithNamedBindPlaceholderElsewhere ()
297
+ {
298
+ $ query = new Query ($ this ->db );
299
+ $ query ->setQuery ('SELECT * FROM posts WHERE id = ? AND title = \'A named bind placeholder looks like ":foobar:" \'' , 10 );
300
+
301
+ $ sql = 'SELECT * FROM posts WHERE id = 10 AND title = \'A named bind placeholder looks like ":foobar:" \'' ;
302
+ $ this ->assertSame ($ sql , $ query ->getQuery ());
303
+ }
304
+
281
305
/**
282
306
* @group single
283
307
*
0 commit comments