MediaWiki  1.23.13
SpecialPageAliasTest.php
Go to the documentation of this file.
1 <?php
2 
15 
20  foreach ( $specialPageAliases as $specialPage => $aliases ) {
21  foreach ( $aliases as $alias ) {
22  $msg = "$specialPage alias '$alias' in $code is valid with no slashes";
23  $this->assertRegExp( '/^[^\/]*$/', $msg );
24  }
25  }
26  }
27 
28  public function validSpecialPageAliasesProvider() {
29  $codes = array_keys( Language::fetchLanguageNames( 'mwfile' ) );
30 
31  $data = array();
32 
33  foreach ( $codes as $code ) {
35 
36  if ( $specialPageAliases !== array() ) {
37  $data[] = array( $code, $specialPageAliases );
38  }
39  }
40 
41  return $data;
42  }
43 
49  protected function getSpecialPageAliases( $code ) {
51 
52  if ( is_readable( $file ) ) {
53  include $file;
54 
55  if ( isset( $specialPageAliases ) && $specialPageAliases !== null ) {
56  return $specialPageAliases;
57  }
58  }
59 
60  return array();
61  }
62 
63 }
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
SpecialPageAliasTest\testValidSpecialPageAliases
testValidSpecialPageAliases( $code, $specialPageAliases)
@dataProvider validSpecialPageAliasesProvider
Definition: SpecialPageAliasTest.php:19
SpecialPageAliasTest\validSpecialPageAliasesProvider
validSpecialPageAliasesProvider()
Definition: SpecialPageAliasTest.php:28
Language\getMessagesFileName
static getMessagesFileName( $code)
Definition: Language.php:4090
Language\fetchLanguageNames
static fetchLanguageNames( $inLanguage=null, $include='mw')
Get an array of language names, indexed by code.
Definition: Language.php:875
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
$specialPageAliases
$specialPageAliases
Definition: MessagesAb.php:58
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
SpecialPageAliasTest\getSpecialPageAliases
getSpecialPageAliases( $code)
Definition: SpecialPageAliasTest.php:49
$file
if(PHP_SAPI !='cli') $file
Definition: UtfNormalTest2.php:30
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
SpecialPageAliasTest
Verifies that special page aliases are valid, with no slashes.
Definition: SpecialPageAliasTest.php:14