wiki.techinc.nl/tests/phpunit/includes/api/query/ApiQueryAllPagesTest.php
Reedy 85396a9c99 tests: Fix @covers and @coversDefaultClass to have leading \
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
2024-02-16 22:43:56 +00:00

38 lines
920 B
PHP

<?php
use MediaWiki\Title\Title;
/**
* @group API
* @group Database
* @group medium
*
* @covers \ApiQueryAllPages
*/
class ApiQueryAllPagesTest extends ApiTestCase {
/**
* Test T27702
* Prefixes of API search requests are not handled with case sensitivity and may result
* in wrong search results
*/
public function testPrefixNormalizationSearchBug() {
$title = Title::makeTitle( NS_CATEGORY, 'Template:xyz' );
$this->editPage(
$title,
'Some text',
'inserting content',
NS_MAIN,
$this->getTestSysop()->getAuthority()
);
$result = $this->doApiRequest( [
'action' => 'query',
'list' => 'allpages',
'apnamespace' => NS_CATEGORY,
'apprefix' => 'Template:x' ] );
$this->assertArrayHasKey( 'query', $result[0] );
$this->assertArrayHasKey( 'allpages', $result[0]['query'] );
$this->assertContains( 'Category:Template:xyz', $result[0]['query']['allpages'][0] );
}
}