X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiQuerySiteinfoTest.php;h=7f5ee0ca3c8a075293022e938ad0d20715d0f8d3;hb=d42d1dbabd7dc81b454cfad8bbbe787cdd3cdf9f;hp=dce1a5feef0e893398aecb875cbe00c45a6546fd;hpb=6aa6eb45885b10a2927fcda7caec8cd88c2b596f;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/ApiQuerySiteinfoTest.php b/tests/phpunit/includes/api/ApiQuerySiteinfoTest.php index dce1a5feef..7f5ee0ca3c 100644 --- a/tests/phpunit/includes/api/ApiQuerySiteinfoTest.php +++ b/tests/phpunit/includes/api/ApiQuerySiteinfoTest.php @@ -665,17 +665,13 @@ class ApiQuerySiteinfoTest extends ApiTestCase { } public function testContinuation() { - // We make lots and lots of URL protocols that are each 100 bytes + // Use $wgUrlProtocols to forge the size of the API query global $wgAPIMaxResultSize, $wgUrlProtocols; - $this->setMwGlobals( 'wgUrlProtocols', [] ); + $protocol = 'foo://'; - // Just under the limit - $chunks = $wgAPIMaxResultSize / 100 - 1; - - for ( $i = 0; $i < $chunks; $i++ ) { - $wgUrlProtocols[] = substr( str_repeat( "$i ", 50 ), 0, 100 ); - } + $this->setMwGlobals( 'wgUrlProtocols', [ $protocol ] ); + $this->setMwGlobals( 'wgAPIMaxResultSize', strlen( $protocol ) ); $res = $this->doApiRequest( [ 'action' => 'query',