MediaWiki
REL1_32
ApiQueryDisabledTest.php
Go to the documentation of this file.
1
<?php
2
9
class
ApiQueryDisabledTest
extends
ApiTestCase
{
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
}
ApiQueryDisabledTest
API medium.
Definition
ApiQueryDisabledTest.php:9
ApiQueryDisabledTest\testDisabled
testDisabled()
Definition
ApiQueryDisabledTest.php:10
ApiTestCase
Definition
ApiTestCase.php:5
ApiTestCase\doApiRequest
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
Definition
ApiTestCase.php:63
MediaWikiTestCase\mergeMwGlobalArrayValue
mergeMwGlobalArrayValue( $name, $values)
Merges the given values into a MW global array variable.
Definition
MediaWikiTestCase.php:901
tests
phpunit
includes
api
ApiQueryDisabledTest.php
Generated on Mon Nov 25 2024 15:58:31 for MediaWiki by
1.10.0