@@ -281,15 +281,21 @@ public function testQueryStringResolvesWithResultWithTypeStringAndRunsUntilQuit(
281
281
282
282
public function provideSqlDataWillBeReturnedWithType ()
283
283
{
284
- return [
285
- ['42 ' , 42 ],
286
- ['1.5 ' , 1.5 ],
287
- ['null ' , null ],
288
- ['"hello" ' , 'hello ' ],
289
- ['"hellö" ' , 'hellö ' ],
290
- ['true ' , 1 ],
291
- ['false ' , 0 ],
292
- ];
284
+ return array_merge (
285
+ [
286
+ ['42 ' , 42 ],
287
+ ['1.5 ' , 1.5 ],
288
+ ['null ' , null ],
289
+ ['"hello" ' , 'hello ' ],
290
+ ['"hellö" ' , 'hellö ' ]
291
+ ],
292
+ (SQLite3::version ()['versionNumber ' ] < 3023000 ) ? [] : [
293
+ // boolean identifiers exist only as of SQLite 3.23.0 (2018-04-02)
294
+ // @link https://www.sqlite.org/lang_expr.html#booleanexpr
295
+ ['true ' , 1 ],
296
+ ['false ' , 0 ]
297
+ ]
298
+ );
293
299
}
294
300
295
301
/**
@@ -308,7 +314,7 @@ public function testQueryValueInStatementResolvesWithResultWithTypeAndRunsUntilQ
308
314
$ promise ->then (function (DatabaseInterface $ db ) use (&$ data , $ value ){
309
315
$ db ->query ('SELECT ' . $ value . ' AS value ' )->then (function (Result $ result ) use (&$ data ) {
310
316
$ data = $ result ->rows ;
311
- });
317
+ }, ' printf ' );
312
318
313
319
$ db ->quit ();
314
320
});
@@ -323,6 +329,7 @@ public function provideDataWillBeReturnedWithType()
323
329
return [
324
330
[0 ],
325
331
[1 ],
332
+ [42 ],
326
333
[1.5 ],
327
334
[null ],
328
335
['hello ' ],
@@ -345,7 +352,7 @@ public function testQueryValuePlaceholderPositionalResolvesWithResultWithExactTy
345
352
$ promise ->then (function (DatabaseInterface $ db ) use (&$ data , $ value ){
346
353
$ db ->query ('SELECT ? AS value ' , array ($ value ))->then (function (Result $ result ) use (&$ data ) {
347
354
$ data = $ result ->rows ;
348
- });
355
+ }, ' printf ' );
349
356
350
357
$ db ->quit ();
351
358
});
@@ -370,7 +377,7 @@ public function testQueryValuePlaceholderNamedResolvesWithResultWithExactTypeAnd
370
377
$ promise ->then (function (DatabaseInterface $ db ) use (&$ data , $ value ){
371
378
$ db ->query ('SELECT :value AS value ' , array ('value ' => $ value ))->then (function (Result $ result ) use (&$ data ) {
372
379
$ data = $ result ->rows ;
373
- });
380
+ }, ' printf ' );
374
381
375
382
$ db ->quit ();
376
383
});
@@ -385,7 +392,7 @@ public function provideDataWillBeReturnedWithOtherType()
385
392
return [
386
393
'true ' => [true , 1 ],
387
394
'false ' => [false , 0 ],
388
- 'float without fraction is int ' => [1 .0 , 1 ]
395
+ 'float without fraction is int ' => [2 .0 , 2 ]
389
396
];
390
397
}
391
398
0 commit comments