@@ -433,7 +433,6 @@ public function testWithString(): void
433
433
*/
434
434
public function testWithArray (): void
435
435
{
436
- // Expected result
437
436
$ expected = new ResultSet (
438
437
[
439
438
new ResultRow (['n.name ' => 'bob1 ' ]),
@@ -448,42 +447,16 @@ public function testWithArray(): void
448
447
new Bookmarks ([])
449
448
);
450
449
451
- // Actual results from API
452
450
$ results = $ this ->api ->run (
453
451
'MATCH (n:Person) WHERE n.name IN $names RETURN n.name ' ,
454
452
['names ' => ['bob1 ' , 'alicy ' ]]
455
453
);
456
454
457
- // Assert counters
458
455
$ this ->assertEquals ($ expected ->getQueryCounters (), $ results ->getQueryCounters ());
459
-
460
- // Compare ResultRows
461
- $ this ->assertCount (count ($ expected ), $ results );
462
-
463
- $ expectedRows = iterator_to_array ($ expected );
464
- $ actualRows = iterator_to_array ($ results );
465
-
466
- $ this ->assertCount (count ($ expectedRows ), $ actualRows );
467
-
468
- // Ensure all expected rows are present in actual results
469
- foreach ($ expectedRows as $ expectedRow ) {
470
- $ found = false ;
471
- foreach ($ actualRows as $ actualRow ) {
472
- if ($ expectedRow == $ actualRow ) {
473
- $ found = true ;
474
- break ;
475
- }
476
- }
477
- $ this ->assertTrue ($ found , "Expected row not found: " . json_encode ($ expectedRow ));
478
- }
479
-
480
- // Check bookmarks count
456
+ $ this ->assertEquals (iterator_to_array ($ expected ), iterator_to_array ($ results ));
481
457
$ this ->assertCount (1 , $ results ->getBookmarks ());
482
458
}
483
459
484
-
485
-
486
-
487
460
public function testWithDate (): void
488
461
{
489
462
$ expected = new ResultSet (
0 commit comments