@@ -313,22 +313,36 @@ public function testValidConnectionCheck(string $alias): void
313313
314314 /**
315315 * @dataProvider connectionAliases
316+ * @param string $alias
316317 */
317- public function testFetchSize (string $ connection ): void
318+ public function testFetchSize (string $ alias ): void
318319 {
319- $ session = $ this ->getClient ()->getDriver ($ connection )->createSession (SessionConfiguration::default ()->withFetchSize (1 ));
320+ $ this ->fetchSize ($ alias , 1 );
321+ $ this ->fetchSize ($ alias , 4 );
322+ $ this ->fetchSize ($ alias , 10 );
323+ }
324+
325+ /**
326+ * @param string $connection
327+ * @param int $fetchSize
328+ * @return void
329+ */
330+ public function fetchSize (string $ connection , int $ fetchSize ): void
331+ {
332+ $ session = $ this ->getClient ()->getDriver ($ connection )->createSession (SessionConfiguration::default ()->withFetchSize ($ fetchSize ));
320333 $ session ->run ('MATCH (x) DETACH DELETE x ' );
321334
322- // Add 4000 user nodes
323- for ($ i = 0 ; $ i < 4 ; ++$ i ) {
335+ $ nodesAmount = $ fetchSize * 4 ;
336+ // Add user nodes
337+ for ($ i = 0 ; $ i < $ nodesAmount ; ++$ i ) {
324338 $ session ->run ('CREATE (user:User) ' );
325339 }
326340
327341 // Confirm that the database contains 4000 unique user nodes
328342 $ userCountResults = $ session ->run ('MATCH (user:User) RETURN COUNT(DISTINCT(ID(user))) as user_count ' );
329343 $ userCount = $ userCountResults ->getAsCypherMap (0 )->getAsInt ('user_count ' );
330344
331- $ this ->assertEquals (4 , $ userCount );
345+ $ this ->assertEquals ($ nodesAmount , $ userCount );
332346
333347 // Retrieve the ids of all user nodes
334348 $ results = $ session ->run ('MATCH (user:User) RETURN ID(user) AS id ' );
@@ -339,12 +353,12 @@ public function testFetchSize(string $connection): void
339353 $ userIds [] = $ result ->get ('id ' );
340354 }
341355
342- $ this ->assertCount (4 , $ userIds );
356+ $ this ->assertCount ($ nodesAmount , $ userIds );
343357
344358 // Check if we have any duplicate ids by removing duplicate values
345359 // from the array.
346360 $ uniqueUserIds = array_unique ($ userIds );
347361
348- $ this ->assertCount (4 , $ uniqueUserIds );
362+ $ this ->assertCount ($ nodesAmount , $ uniqueUserIds );
349363 }
350364}
0 commit comments