Remove superfluous re- from confirmemail_body_set
[mediawiki.git] / tests / phpunit / includes / api / PrefixUniquenessTest.php
blobd9be85e3205231ad3750b2e3f11b11f54fedcf7e
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 {
9 public function testPrefixes() {
10 $main = new ApiMain( new FauxRequest() );
11 $query = new ApiQuery( $main, 'foo', 'bar' );
12 $modules = $query->getModuleManager()->getNamesWithClasses();
13 $prefixes = array();
15 foreach ( $modules as $name => $class ) {
16 $module = new $class( $main, $name );
17 $prefix = $module->getModulePrefix();
18 if ( isset( $prefixes[$prefix] ) ) {
19 $this->fail( "Module prefix '{$prefix}' is shared between {$class} and {$prefixes[$prefix]}" );
21 $prefixes[$module->getModulePrefix()] = $class;
23 $this->assertTrue( true ); // dummy call to make this test non-incomplete