Merge "Remove use of BagOStuff TTL constants from unrelated code"
[mediawiki.git] / tests / phpunit / includes / api / query / ApiQueryDisabledTest.php
blobd060920cbaa3448dab7e4b39fb672bbf76887d41
1 <?php
3 namespace MediaWiki\Tests\Api\Query;
5 use MediaWiki\Tests\Api\ApiTestCase;
7 /**
8 * @group API
9 * @group medium
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( [
19 'action' => 'query',
20 'prop' => 'categories',
21 ] );
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'] );