diff --git a/phpunit/ApiTest.php b/phpunit/ApiTest.php new file mode 100644 index 0000000..a060232 --- /dev/null +++ b/phpunit/ApiTest.php @@ -0,0 +1,44 @@ +createQuery( [ + 'action' => 'query', + 'list' => 'categorymembers', + 'cmtitle' => 'Categoria:Software con licenza GNU GPL', + 'cmlimit' => 3, + ] ); + + $i = 0; + + foreach( $queries as $query ) { + + foreach( $query->query->categorymembers as $member ) { + + $member->pageid; + $member->ns; + $member->title; + + $i++; + } + + // don't do other requests + break; + } + + // it should return just 3 elements for this series + $this->assertEquals( $i, 3 ); + } + +}