@@ -433,10 +433,11 @@ public function testWithString(): void
433
433
*/
434
434
public function testWithArray (): void
435
435
{
436
+ // Expected result
436
437
$ expected = new ResultSet (
437
438
[
438
- new ResultRow (['n.name ' => 'alicy ' ]),
439
- new ResultRow (['n.name ' => 'bob1 ' ])
439
+ new ResultRow (['n.name ' => 'bob1 ' ]),
440
+ new ResultRow (['n.name ' => 'alicy ' ])
440
441
],
441
442
new ResultCounters (
442
443
containsUpdates: false ,
@@ -447,16 +448,32 @@ public function testWithArray(): void
447
448
new Bookmarks ([])
448
449
);
449
450
451
+ // Actual results from API
450
452
$ results = $ this ->api ->run (
451
453
'MATCH (n:Person) WHERE n.name IN $names RETURN n.name ' ,
452
454
['names ' => ['bob1 ' , 'alicy ' ]]
453
455
);
454
456
457
+ // Assert counters
455
458
$ this ->assertEquals ($ expected ->getQueryCounters (), $ results ->getQueryCounters ());
456
- $ this ->assertEquals (iterator_to_array ($ expected ), iterator_to_array ($ results ));
459
+
460
+ // Assert the number of ResultRows
461
+ $ this ->assertCount (count (iterator_to_array ($ expected )), iterator_to_array ($ results ));
462
+
463
+ // Convert to arrays for comparison
464
+ $ expectedRows = iterator_to_array ($ expected );
465
+ $ actualRows = iterator_to_array ($ results );
466
+
467
+ // Ensure all expected rows are present in actual results
468
+ foreach ($ expectedRows as $ expectedRow ) {
469
+ $ this ->assertContains ($ expectedRow , $ actualRows , "Expected row not found: " . json_encode ($ expectedRow ));
470
+ }
471
+
472
+ // Check bookmarks count
457
473
$ this ->assertCount (1 , $ results ->getBookmarks ());
458
474
}
459
475
476
+
460
477
public function testWithDate (): void
461
478
{
462
479
$ expected = new ResultSet (
0 commit comments