7 * @covers ApiQueryDisabled
9 class ApiQueryDisabledTest
extends ApiTestCase
{
10 public function testDisabled() {
11 $this->mergeMwGlobalArrayValue( 'wgAPIPropModules',
12 [ 'categories' => 'ApiQueryDisabled' ] );
14 $data = $this->doApiRequest( [
16 'prop' => 'categories',
19 $this->assertArrayHasKey( 'warnings', $data[0] );
20 $this->assertArrayHasKey( 'categories', $data[0]['warnings'] );
21 $this->assertArrayHasKey( 'warnings', $data[0]['warnings']['categories'] );
23 $this->assertEquals( 'The "categories" module has been disabled.',
24 $data[0]['warnings']['categories']['warnings'] );