@@ -295,138 +295,210 @@ public function if(PDO $pdo): void
295295 foreach ($ stmt as $ row ) {
296296 assertType ("array{col: 1|'a', 0: 1|'a'} " , $ row );
297297 }
298- assertType ("PDOStatement<> " , $ stmt );
299298
300299 $ stmt = $ pdo ->query ('SELECT if(freigabe1u1 > 100, freigabe1u1, "nope") as col from ada ' );
301- assertType ("PDOStatement<array{col: 'nope'|int<-32768, 32767>, 0: 'nope'|int<-32768, 32767>}> " , $ stmt ); // could be 'nope'|int<100, 127>
300+ foreach ($ stmt as $ row ) {
301+ assertType ("array{col: 'nope'|int<-32768, 32767>, 0: 'nope'|int<-32768, 32767>} " , $ row ); // could be 'nope'|int<100, 127>
302+ }
302303
303304 $ stmt = $ pdo ->query ('SELECT if(freigabe1u1 > 100, if(gesperrt <> 1, "a", "b"), "other") as col from ada ' );
304- assertType ("PDOStatement<array{col: 'a'|'b'|'other', 0: 'a'|'b'|'other'}> " , $ stmt );
305+ foreach ($ stmt as $ row ) {
306+ assertType ("array{col: 'a'|'b'|'other', 0: 'a'|'b'|'other'} " , $ row );
307+ }
305308 }
306309
307310 public function caseWhen (PDO $ pdo ): void
308311 {
309312 $ stmt = $ pdo ->query ("SELECT CASE 1 WHEN 1 THEN 'one' WHEN 2 THEN 'two' ELSE 'more' END as val from ada " );
310- assertType ("PDOStatement<array{val: 'more'|'one'|'two', 0: 'more'|'one'|'two'}> " , $ stmt );
313+ foreach ($ stmt as $ row ) {
314+ assertType ("array{val: 'more'|'one'|'two', 0: 'more'|'one'|'two'} " , $ row );
315+ }
311316
312317 $ stmt = $ pdo ->query ("SELECT
313318 CASE
314319 WHEN freigabe1u1 > 50 THEN 'big-one'
315320 WHEN freigabe1u1 = 50 THEN 'normal'
316321 ELSE freigabe1u1
317322 END as val from ada " );
318- assertType ("PDOStatement<array{val: 'big-one'|'normal'|int<-32768, 32767>, 0: 'big-one'|'normal'|int<-32768, 32767>}> " , $ stmt ); // could be 'big-one'|'normal'|int<-128, 49>
323+ foreach ($ stmt as $ row ) {
324+ // could be 'big-one'|'normal'|int<-128, 49>
325+ assertType ("array{val: 'big-one'|'normal'|int<-32768, 32767>, 0: 'big-one'|'normal'|int<-32768, 32767>} " , $ row );
326+ }
319327 }
320328
321329 public function concat (PDO $ pdo ): void
322330 {
323331 $ stmt = $ pdo ->query ('SELECT concat(akid, 5000) as col from ak ' );
324- assertType ('PDOStatement<array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string}> ' , $ stmt );
332+ foreach ($ stmt as $ row ) {
333+ assertType ("array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string} " , $ row );
334+ }
325335
326336 $ stmt = $ pdo ->query ('SELECT concat(eladaid, 5000) as col from ak ' );
327- assertType ("PDOStatement<array{col: (non-empty-string&numeric-string)|null, 0: (non-empty-string&numeric-string)|null}> " , $ stmt );
337+ foreach ($ stmt as $ row ) {
338+ assertType ("array{col: (non-empty-string&numeric-string)|null, 0: (non-empty-string&numeric-string)|null} " , $ row );
339+ }
328340
329341 $ stmt = $ pdo ->query ('SELECT concat(eladaid, akid) as col from ak ' );
330- assertType ("PDOStatement<array{col: (non-empty-string&numeric-string)|null, 0: (non-empty-string&numeric-string)|null}> " , $ stmt );
342+ foreach ($ stmt as $ row ) {
343+ assertType ("array{col: (non-empty-string&numeric-string)|null, 0: (non-empty-string&numeric-string)|null} " , $ row );
344+ }
331345
332346 $ stmt = $ pdo ->query ('SELECT concat(eladaid, null) as col from ak ' );
333- assertType ('PDOStatement<array{col: null, 0: null}> ' , $ stmt );
347+ foreach ($ stmt as $ row ) {
348+ assertType ("array{col: null, 0: null} " , $ row );
349+ }
334350
335351 $ stmt = $ pdo ->query ('SELECT concat("abc", akid, 5000) as col from ak ' );
336- assertType ('PDOStatement<array{col: non-falsy-string, 0: non-falsy-string}> ' , $ stmt );
352+ foreach ($ stmt as $ row ) {
353+ assertType ("array{col: non-falsy-string, 0: non-falsy-string} " , $ row );
354+ }
337355 }
338356
339357 public function concat_ws (PDO $ pdo ): void
340358 {
341359 $ stmt = $ pdo ->query ('SELECT concat_ws(akid, 5000) as col from ak ' );
342- assertType ('PDOStatement<array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string}> ' , $ stmt );
360+ foreach ($ stmt as $ row ) {
361+ assertType ("array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string} " , $ row );
362+ }
343363
344364 $ stmt = $ pdo ->query ('SELECT concat_ws(eladaid, 5000) as col from ak ' );
345- assertType ("PDOStatement<array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string}> " , $ stmt );
365+ foreach ($ stmt as $ row ) {
366+ assertType ("array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string} " , $ row );
367+ }
346368
347369 $ stmt = $ pdo ->query ('SELECT concat_ws(eladaid, akid) as col from ak ' );
348- assertType ("PDOStatement<array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string}> " , $ stmt );
370+ foreach ($ stmt as $ row ) {
371+ assertType ("array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string} " , $ row );
372+ }
349373
350374 $ stmt = $ pdo ->query ('SELECT concat_ws(eladaid, null) as col from ak ' );
351- assertType ('PDOStatement<array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string}> ' , $ stmt );
375+ foreach ($ stmt as $ row ) {
376+ assertType ("array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string} " , $ row );
377+ }
352378
353379 $ stmt = $ pdo ->query ('SELECT concat_ws("abc", akid, 5000) as col from ak ' );
354- assertType ('PDOStatement<array{col: non-falsy-string, 0: non-falsy-string}> ' , $ stmt );
380+ foreach ($ stmt as $ row ) {
381+ assertType ("array{col: non-falsy-string, 0: non-falsy-string} " , $ row );
382+ }
355383 }
356384
357385 public function posIntReturn (PDO $ pdo ): void
358386 {
359387 $ stmt = $ pdo ->query ('SELECT length(akid) as col from ak ' );
360- assertType ("PDOStatement<array{col: int<0, max>, 0: int<0, max>}> " , $ stmt );
388+ foreach ($ stmt as $ row ) {
389+ assertType ("array{col: int<0, max>, 0: int<0, max>} " , $ row );
390+ }
361391
362392 $ stmt = $ pdo ->query ('SELECT char_length(eladaid) as col from ak ' );
363- assertType ("PDOStatement<array{col: int<0, max>, 0: int<0, max>}> " , $ stmt );
393+ foreach ($ stmt as $ row ) {
394+ assertType ("array{col: int<0, max>, 0: int<0, max>} " , $ row );
395+ }
364396
365397 $ stmt = $ pdo ->query ('SELECT character_length(eladaid) as col from ak ' );
366- assertType ("PDOStatement<array{col: int<0, max>, 0: int<0, max>}> " , $ stmt );
398+ foreach ($ stmt as $ row ) {
399+ assertType ("array{col: int<0, max>, 0: int<0, max>} " , $ row );
400+ }
367401
368402 $ stmt = $ pdo ->query ('SELECT octet_length(eladaid) as col from ak ' );
369- assertType ("PDOStatement<array{col: int<0, max>, 0: int<0, max>}> " , $ stmt );
403+ foreach ($ stmt as $ row ) {
404+ assertType ("array{col: int<0, max>, 0: int<0, max>} " , $ row );
405+ }
370406
371407 $ stmt = $ pdo ->query ("SELECT FIELD('Bb', 'Aa', 'Bb', 'Cc', 'Dd', 'Ff') as field from ak " );
372- assertType ("PDOStatement<array{field: int<0, max>, 0: int<0, max>}> " , $ stmt );
408+ foreach ($ stmt as $ row ) {
409+ assertType ("array{field: int<0, max>, 0: int<0, max>} " , $ row );
410+ }
373411 }
374412
375413 public function instr (PDO $ pdo ): void
376414 {
377415 $ stmt = $ pdo ->query ("SELECT instr('foobarbar', 'bar') as field from ak " );
378- assertType ("PDOStatement<array{field: int<0, max>, 0: int<0, max>}> " , $ stmt );
416+ foreach ($ stmt as $ row ) {
417+ assertType ("array{field: int<0, max>, 0: int<0, max>} " , $ row );
418+ }
379419
380420 $ stmt = $ pdo ->query ("SELECT instr(eladaid, 'bar') as field from ak " );
381- assertType ("PDOStatement<array{field: int<0, max>|null, 0: int<0, max>|null}> " , $ stmt );
421+ foreach ($ stmt as $ row ) {
422+ assertType ("array{field: int<0, max>|null, 0: int<0, max>|null} " , $ row );
423+ }
382424
383425 $ stmt = $ pdo ->query ("SELECT instr(akid, 'bar') as field from ak " );
384- assertType ("PDOStatement<array{field: int<0, max>, 0: int<0, max>}> " , $ stmt );
426+ foreach ($ stmt as $ row ) {
427+ assertType ("array{field: int<0, max>, 0: int<0, max>} " , $ row );
428+ }
385429
386430 $ stmt = $ pdo ->query ("SELECT locate('foo', eladaid, 'bar') as field from ak " );
387- assertType ("PDOStatement<array{field: int<0, max>|null, 0: int<0, max>|null}> " , $ stmt );
431+ foreach ($ stmt as $ row ) {
432+ assertType ("array{field: int<0, max>|null, 0: int<0, max>|null} " , $ row );
433+ }
388434
389435 $ stmt = $ pdo ->query ("SELECT locate(eladaid, 'bar') as field from ak " );
390- assertType ("PDOStatement<array{field: int<0, max>|null, 0: int<0, max>|null}> " , $ stmt );
436+ foreach ($ stmt as $ row ) {
437+ assertType ("array{field: int<0, max>|null, 0: int<0, max>|null} " , $ row );
438+ }
391439
392440 $ stmt = $ pdo ->query ("SELECT locate(akid, 'bar') as field from ak " );
393- assertType ("PDOStatement<array{field: int<0, max>, 0: int<0, max>}> " , $ stmt );
441+ foreach ($ stmt as $ row ) {
442+ assertType ("array{field: int<0, max>, 0: int<0, max>} " , $ row );
443+ }
394444 }
395445
396446 public function strcase (PDO $ pdo ): void
397447 {
398448 $ stmt = $ pdo ->query ("SELECT lcase(c_varbinary255) as field from typemix " );
399- assertType ("PDOStatement<array{field: string, 0: string}> " , $ stmt );
449+ foreach ($ stmt as $ row ) {
450+ assertType ("array{field: string, 0: string} " , $ row );
451+ }
400452
401453 $ stmt = $ pdo ->query ("SELECT ucase(c_varbinary25) as field from typemix " );
402- assertType ("PDOStatement<array{field: string|null, 0: string|null}> " , $ stmt );
454+ foreach ($ stmt as $ row ) {
455+ assertType ("array{field: string|null, 0: string|null} " , $ row );
456+ }
403457
404458 $ stmt = $ pdo ->query ("SELECT lower(c_varbinary255) as field from typemix " );
405- assertType ("PDOStatement<array{field: string, 0: string}> " , $ stmt );
459+ foreach ($ stmt as $ row ) {
460+ assertType ("array{field: string, 0: string} " , $ row );
461+ }
406462
407463 $ stmt = $ pdo ->query ("SELECT lower(c_varbinary25) as field from typemix " );
408- assertType ("PDOStatement<array{field: string|null, 0: string|null}> " , $ stmt );
464+ foreach ($ stmt as $ row ) {
465+ assertType ("array{field: string|null, 0: string|null} " , $ row );
466+ }
409467
410468 $ stmt = $ pdo ->query ("SELECT lower(null) as field from ak " );
411- assertType ("PDOStatement<array{field: null, 0: null}> " , $ stmt );
469+ foreach ($ stmt as $ row ) {
470+ assertType ("array{field: null, 0: null} " , $ row );
471+ }
412472
413473 $ stmt = $ pdo ->query ("SELECT lower('foobarbar') as field from ak " );
414- assertType ("PDOStatement<array{field: 'foobarbar', 0: 'foobarbar'}> " , $ stmt );
474+ foreach ($ stmt as $ row ) {
475+ assertType ("array{field: 'foobarbar', 0: 'foobarbar'} " , $ row );
476+ }
415477
416478 $ stmt = $ pdo ->query ("SELECT lower('FOO') as field from ak " );
417- assertType ("PDOStatement<array{field: 'foo', 0: 'foo'}> " , $ stmt );
479+ foreach ($ stmt as $ row ) {
480+ assertType ("array{field: 'foo', 0: 'foo'} " , $ row );
481+ }
418482
419483 $ stmt = $ pdo ->query ("SELECT upper('foobarbar') as field from ak " );
420- assertType ("PDOStatement<array{field: 'FOOBARBAR', 0: 'FOOBARBAR'}> " , $ stmt );
484+ foreach ($ stmt as $ row ) {
485+ assertType ("array{field: 'FOOBARBAR', 0: 'FOOBARBAR'} " , $ row );
486+ }
421487
422488 $ stmt = $ pdo ->query ("SELECT upper('fooBARbar') as field from ak " );
423- assertType ("PDOStatement<array{field: 'FOOBARBAR', 0: 'FOOBARBAR'}> " , $ stmt );
489+ foreach ($ stmt as $ row ) {
490+ assertType ("array{field: 'FOOBARBAR', 0: 'FOOBARBAR'} " , $ row );
491+ }
424492
425493 $ stmt = $ pdo ->query ("SELECT lower(upper('foobarbar')) as field from ak " );
426- assertType ("PDOStatement<array{field: 'foobarbar', 0: 'foobarbar'}> " , $ stmt );
494+ foreach ($ stmt as $ row ) {
495+ assertType ("array{field: 'foobarbar', 0: 'foobarbar'} " , $ row );
496+ }
427497
428498 $ stmt = $ pdo ->query ('SELECT lower(concat(akid, 5000)) as col from ak ' );
429- assertType ('PDOStatement<array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string}> ' , $ stmt );
499+ foreach ($ stmt as $ row ) {
500+ assertType ("array{col: non-empty-string&numeric-string, 0: non-empty-string&numeric-string} " , $ row );
501+ }
430502 }
431503
432504 public function avg (PDO $ pdo ): void
0 commit comments