}
/**
- * @todo give this test a real name explaining what is being tested here
+ *Test bug 25702
+ *Prefixes of API search requests are not handled with case sensitivity and may result
+ *in wrong search results
*/
- public function testBug25702() {
+ public function testPrefixNormalizationSearchBug() {
$title = Title::newFromText( 'Category:Template:xyz' );
$page = WikiPage::factory( $title );
- $page->doEdit( 'Some text', 'inserting content' );
- $result = $this->doApiRequest( array(
+ $page->doEditContent(
+ ContentHandler::makeContent( 'Some text', $page->getTitle() ),
+ 'inserting content'
+ );
+
+ $result = $this->doApiRequest( [
'action' => 'query',
'list' => 'allpages',
'apnamespace' => NS_CATEGORY,
- 'apprefix' => 'Template:x' ) );
+ 'apprefix' => 'Template:x' ] );
$this->assertArrayHasKey( 'query', $result[0] );
$this->assertArrayHasKey( 'allpages', $result[0]['query'] );