3 namespace MediaWiki\Tests\Api\Query
;
5 use MediaWiki\Tests\Api\ApiTestCase
;
11 * @covers \MediaWiki\Api\ApiQueryDisabled
13 class ApiQueryDisabledTest
extends ApiTestCase
{
14 public function testDisabled() {
15 $this->mergeMwGlobalArrayValue( 'wgAPIPropModules',
16 [ 'categories' => 'ApiQueryDisabled' ] );
18 $data = $this->doApiRequest( [
20 'prop' => 'categories',
23 $this->assertArrayHasKey( 'warnings', $data[0] );
24 $this->assertArrayHasKey( 'categories', $data[0]['warnings'] );
25 $this->assertArrayHasKey( 'warnings', $data[0]['warnings']['categories'] );
27 $this->assertEquals( 'The "categories" module has been disabled.',
28 $data[0]['warnings']['categories']['warnings'] );