Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / api / PrefixUniquenessTest.php
bloba1fc2c296e6d7ce9b7c13e99d9af92b3a0550e38
1 <?php
3 /**
4 * Checks that all API query modules, core and extensions, have unique prefixes.
6 * @group API
7 */
8 class PrefixUniquenessTest extends MediaWikiTestCase {
10 public function testPrefixes() {
11 $main = new ApiMain( new FauxRequest() );
12 $query = new ApiQuery( $main, 'foo', 'bar' );
13 $modules = $query->getModuleManager()->getNamesWithClasses();
14 $prefixes = array();
16 foreach ( $modules as $name => $class ) {
17 /** @var ApiMain $module */
18 $module = new $class( $main, $name );
19 $prefix = $module->getModulePrefix();
20 if ( isset( $prefixes[$prefix] ) ) {
21 $this->fail( "Module prefix '{$prefix}' is shared between {$class} and {$prefixes[$prefix]}" );
23 $prefixes[$module->getModulePrefix()] = $class;
25 $this->assertTrue( true ); // dummy call to make this test non-incomplete