summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/cache
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /tests/phpunit/includes/cache
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'tests/phpunit/includes/cache')
-rw-r--r--tests/phpunit/includes/cache/MessageCacheTest.php29
1 files changed, 25 insertions, 4 deletions
diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php
index 442e9f9f..5302b363 100644
--- a/tests/phpunit/includes/cache/MessageCacheTest.php
+++ b/tests/phpunit/includes/cache/MessageCacheTest.php
@@ -52,7 +52,7 @@ class MessageCacheTest extends MediaWikiLangTestCase {
$this->makePage( 'MessageCacheTest-FullKeyTest', 'ru' );
// In content language -- get base if no derivative
- $this->makePage( 'FallbackLanguageTest-NoDervContLang', 'de', 'de/none', false );
+ $this->makePage( 'FallbackLanguageTest-NoDervContLang', 'de', 'de/none' );
}
/**
@@ -61,15 +61,14 @@ class MessageCacheTest extends MediaWikiLangTestCase {
* @param string $title Title of page to be created
* @param string $lang Language and content of the created page
* @param string|null $content Content of the created page, or null for a generic string
- * @param bool $createSubPage Set to false if a root page should be created
*/
- protected function makePage( $title, $lang, $content = null, $createSubPage = true ) {
+ protected function makePage( $title, $lang, $content = null ) {
global $wgContLang;
if ( $content === null ) {
$content = $lang;
}
- if ( $lang !== $wgContLang->getCode() || $createSubPage ) {
+ if ( $lang !== $wgContLang->getCode() ) {
$title = "$title/$lang";
}
@@ -125,4 +124,26 @@ class MessageCacheTest extends MediaWikiLangTestCase {
);
}
+ /**
+ * @dataProvider provideNormalizeKey
+ */
+ public function testNormalizeKey( $key, $expected ) {
+ $actual = MessageCache::normalizeKey( $key );
+ $this->assertEquals( $expected, $actual );
+ }
+
+ public function provideNormalizeKey() {
+ return array(
+ array( 'Foo', 'foo' ),
+ array( 'foo', 'foo' ),
+ array( 'fOo', 'fOo' ),
+ array( 'FOO', 'fOO' ),
+ array( 'Foo bar', 'foo_bar' ),
+ array( 'Ćab', 'ćab' ),
+ array( 'Ćab_e 3', 'ćab_e_3' ),
+ array( 'ĆAB', 'ćAB' ),
+ array( 'ćab', 'ćab' ),
+ array( 'ćaB', 'ćaB' ),
+ );
+ }
}