From: Brian Wolff Date: Sun, 19 Jul 2015 09:02:57 +0000 (-0600) Subject: Add tests for 47e0f0c3 (MessageCache::normalizeKey()) X-Git-Tag: 1.31.0-rc.0~10716 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=fb395bba7d44da58537f671470ea32b6d58bbb35;p=lhc%2Fweb%2Fwiklou.git Add tests for 47e0f0c3 (MessageCache::normalizeKey()) Change-Id: If8c88383ccfcfcf08d3d85e5648eb338f0d14268 --- diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php index 9c59e659f9..5302b363a3 100644 --- a/tests/phpunit/includes/cache/MessageCacheTest.php +++ b/tests/phpunit/includes/cache/MessageCacheTest.php @@ -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' ), + ); + } }