MediaWiki
REL1_31
PrefixUniquenessTest.php
Go to the documentation of this file.
1
<?php
2
8
class
PrefixUniquenessTest
extends
MediaWikiTestCase
{
9
10
public
function
testPrefixes
() {
11
$main =
new
ApiMain
(
new
FauxRequest
() );
12
$query
=
new
ApiQuery
( $main,
'foo'
,
'bar'
);
13
$moduleManager =
$query
->getModuleManager();
14
15
$modules
= $moduleManager->getNames();
16
$prefixes = [];
17
18
foreach
(
$modules
as $name ) {
19
$module = $moduleManager->getModule( $name );
20
$class = get_class( $module );
21
22
$prefix = $module->getModulePrefix();
23
if
( $prefix !==
''
&& isset( $prefixes[$prefix] ) ) {
24
$this->fail(
"Module prefix '{$prefix}' is shared between {$class} and {$prefixes[$prefix]}"
);
25
}
26
$prefixes[$module->getModulePrefix()] = $class;
27
}
28
$this->assertTrue(
true
);
// dummy call to make this test non-incomplete
29
}
30
}
$modules
$modules
Definition
HTMLFormElement.php:12
ApiMain
This is the main API class, used for both external and internal processing.
Definition
ApiMain.php:43
ApiQuery
This is the main query class.
Definition
ApiQuery.php:36
FauxRequest
WebRequest clone which takes values from a provided array.
Definition
FauxRequest.php:33
MediaWikiTestCase
Definition
MediaWikiTestCase.php:17
PrefixUniquenessTest
Checks that all API query modules, core and extensions, have unique prefixes.
Definition
PrefixUniquenessTest.php:8
PrefixUniquenessTest\testPrefixes
testPrefixes()
Definition
PrefixUniquenessTest.php:10
$query
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition
hooks.txt:1620
tests
phpunit
includes
api
PrefixUniquenessTest.php
Generated on Mon Nov 25 2024 15:36:15 for MediaWiki by
1.10.0