@@ -45,6 +45,14 @@ protected static function formatter(): FormatterInterface
45
45
return SummarizedResultFormatter::create ();
46
46
}
47
47
48
+ protected function setUp (): void
49
+ {
50
+ parent ::setUp ();
51
+ foreach (self ::connectionAliases () as $ alias ) {
52
+ $ this ->getClient ()->run ('MATCH (x) DETACH DELETE x ' , [], $ alias [0 ]);
53
+ }
54
+ }
55
+
48
56
protected static function createClient (): ClientInterface
49
57
{
50
58
$ connections = self ::buildConnections ();
@@ -499,6 +507,42 @@ public function testConstraintHandling(string $alias): void
499
507
$ session ->run ("CREATE (test:Test {id: '123'}) RETURN test " );
500
508
}
501
509
510
+ /**
511
+ * @dataProvider connectionAliases
512
+ */
513
+ public function testFetchSize (string $ alias ): void
514
+ {
515
+ $ client = $ this ->getClient ();
516
+
517
+ // Add 4000 user nodes
518
+ for ($ i = 0 ; $ i < 4000 ; ++$ i ) {
519
+ $ client ->run ('CREATE (user:User) ' , [], $ alias );
520
+ }
521
+
522
+ // Confirm that the database contains 4000 unique user nodes
523
+ $ userCountResults = $ client ->run ('MATCH (user:User) RETURN COUNT(DISTINCT(ID(user))) as user_count ' , [], $ alias );
524
+ $ userCount = $ userCountResults ->getAsMap (0 )->getAsInt ('user_count ' );
525
+
526
+ $ this ->assertEquals (4000 , $ userCount );
527
+
528
+ // Retrieve the ids of all user nodes
529
+ $ results = $ client ->run ('MATCH (user:User) RETURN ID(user) AS id ' , [], $ alias );
530
+
531
+ // Loop through the results and add each id to an array
532
+ $ userIds = [];
533
+ foreach ($ results as $ result ) {
534
+ $ userIds [] = $ result ->get ('id ' );
535
+ }
536
+
537
+ $ this ->assertCount (4000 , $ userIds );
538
+
539
+ // Check if we have any duplicate ids by removing duplicate values
540
+ // from the array.
541
+ $ uniqueUserIds = array_unique ($ userIds );
542
+
543
+ $ this ->assertEquals ($ userIds , $ uniqueUserIds );
544
+ }
545
+
502
546
/**
503
547
* @dataProvider connectionAliases
504
548
*/
0 commit comments