Add tests for 47e0f0c3 (MessageCache::normalizeKey())
[lhc/web/wiklou.git] / tests / phpunit / includes / cache / MessageCacheTest.php
index 9c59e65..5302b36 100644 (file)
@@ -124,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' ),
+               );
+       }
 }