MediaWiki REL1_32
ApiQueryDisabledTest.php
Go to the documentation of this file.
1<?php
2
10 public function testDisabled() {
11 $this->mergeMwGlobalArrayValue( 'wgAPIPropModules',
12 [ 'categories' => 'ApiQueryDisabled' ] );
13
14 $data = $this->doApiRequest( [
15 'action' => 'query',
16 'prop' => 'categories',
17 ] );
18
19 $this->assertArrayHasKey( 'warnings', $data[0] );
20 $this->assertArrayHasKey( 'categories', $data[0]['warnings'] );
21 $this->assertArrayHasKey( 'warnings', $data[0]['warnings']['categories'] );
22
23 $this->assertEquals( 'The "categories" module has been disabled.',
24 $data[0]['warnings']['categories']['warnings'] );
25 }
26}
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
mergeMwGlobalArrayValue( $name, $values)
Merges the given values into a MW global array variable.