@@ -242,6 +242,55 @@ public function testStatementWithFullCount()
242
242
$ this ->assertEquals (3 , $ cursor ->getFullCount (), "The fullCount should be 3 " );
243
243
}
244
244
245
+
246
+ public function testBindReservedValue ()
247
+ {
248
+ $ connection = $ this ->connection ;
249
+ $ collection = $ this ->collection ;
250
+
251
+ $ documentHandler = new DocumentHandler ($ connection );
252
+
253
+ $ document = new Document ();
254
+ $ document ->file = 'testFooBar ' ;
255
+ $ documentHandler ->add ($ collection ->getId (), $ document );
256
+
257
+ $ statement = new Statement ($ connection , array (
258
+ "query " => 'FOR a IN `ArangoDB_PHP_TestSuite_TestCollection_01` FILTER a.file == @file RETURN a.file ' ,
259
+ "bindVars " => array ("file " => "testFooBar " ),
260
+ "_sanitize " => true
261
+ ));
262
+
263
+ $ cursor = $ statement ->execute ();
264
+
265
+ $ rows = $ cursor ->getAll ();
266
+ $ this ->assertEquals ("testFooBar " , $ rows [0 ]);
267
+ }
268
+
269
+
270
+ public function testBindReservedName ()
271
+ {
272
+ $ connection = $ this ->connection ;
273
+ $ collection = $ this ->collection ;
274
+
275
+ $ documentHandler = new DocumentHandler ($ connection );
276
+
277
+ $ document = new Document ();
278
+ $ document ->test = 'file ' ;
279
+ $ documentHandler ->add ($ collection ->getId (), $ document );
280
+
281
+ $ statement = new Statement ($ connection , array (
282
+ "query " => 'FOR a IN `ArangoDB_PHP_TestSuite_TestCollection_01` FILTER a.test == @test RETURN a.test ' ,
283
+ "bindVars " => array ("test " => "file " ),
284
+ "_sanitize " => true
285
+ ));
286
+
287
+ $ cursor = $ statement ->execute ();
288
+
289
+ $ rows = $ cursor ->getAll ();
290
+ $ this ->assertEquals ("file " , $ rows [0 ]);
291
+ }
292
+
293
+
245
294
public function tearDown ()
246
295
{
247
296
try {
0 commit comments