13
13
use PHPUnit \Framework \Attributes \DataProvider ;
14
14
use PHPUnit \Framework \TestCase ;
15
15
use Neo4j \QueryAPI \Transaction ;
16
- use Psr \Http \Client \RequestExceptionInterface ;
17
16
18
17
class Neo4jQueryAPIIntegrationTest extends TestCase
19
18
{
@@ -427,13 +426,8 @@ public function testWithString(): void
427
426
$ this ->assertCount (1 , $ results ->getBookmarks ());
428
427
}
429
428
430
- /**
431
- * @throws Neo4jException
432
- * @throws RequestExceptionInterface
433
- */
434
429
public function testWithArray (): void
435
430
{
436
- // Expected result
437
431
$ expected = new ResultSet (
438
432
[
439
433
new ResultRow (['n.name ' => 'bob1 ' ]),
@@ -448,32 +442,16 @@ public function testWithArray(): void
448
442
new Bookmarks ([])
449
443
);
450
444
451
- // Actual results from API
452
445
$ results = $ this ->api ->run (
453
446
'MATCH (n:Person) WHERE n.name IN $names RETURN n.name ' ,
454
447
['names ' => ['bob1 ' , 'alicy ' ]]
455
448
);
456
449
457
- // Assert counters
458
450
$ this ->assertEquals ($ expected ->getQueryCounters (), $ results ->getQueryCounters ());
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
451
+ $ this ->assertEquals (iterator_to_array ($ expected ), iterator_to_array ($ results ));
473
452
$ this ->assertCount (1 , $ results ->getBookmarks ());
474
453
}
475
454
476
-
477
455
public function testWithDate (): void
478
456
{
479
457
$ expected = new ResultSet (
0 commit comments