diff --git a/phpunit/ApiTest.php b/phpunit/ApiTest.php index a060232..246ddbb 100644 --- a/phpunit/ApiTest.php +++ b/phpunit/ApiTest.php @@ -1,44 +1,46 @@ createQuery( [ 'action' => 'query', 'list' => 'categorymembers', 'cmtitle' => 'Categoria:Software con licenza GNU GPL', - 'cmlimit' => 3, + 'cmlimit' => $limit, ] ); $i = 0; - foreach( $queries as $query ) { - foreach( $query->query->categorymembers as $member ) { $member->pageid; $member->ns; $member->title; + // count the pages $i++; } - // don't do other requests + // it's not necessary to do consecutive queries + // this is just a test on the first page break; } - // it should return just 3 elements for this series - $this->assertEquals( $i, 3 ); + // check whenever we were able to find $limit pages + $this->assertEquals( $i, $limit ); } }