MediaWiki  1.23.6
PrefixUniquenessTest.php
Go to the documentation of this file.
1 <?php
2 
9 
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();
15 
16  foreach ( $modules as $name => $class ) {
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]}" );
22  }
23  $prefixes[$module->getModulePrefix()] = $class;
24  }
25  $this->assertTrue( true ); // dummy call to make this test non-incomplete
26  }
27 }
ApiMain
This is the main API class, used for both external and internal processing.
Definition: ApiMain.php:41
FauxRequest
WebRequest clone which takes values from a provided array.
Definition: WebRequest.php:1275
ApiQuery
This is the main query class.
Definition: ApiQuery.php:38
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
PrefixUniquenessTest\testPrefixes
testPrefixes()
Definition: PrefixUniquenessTest.php:10
fail
as a message key or array as accepted by ApiBase::dieUsageMsg after processing request parameters Return false to let the request fail
Definition: hooks.txt:375
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
PrefixUniquenessTest
Checks that all API query modules, core and extensions, have unique prefixes.
Definition: PrefixUniquenessTest.php:8
$query
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1105