diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
commit | 63601400e476c6cf43d985f3e7b9864681695ed4 (patch) | |
tree | f7846203a952e38aaf66989d0a4702779f549962 /tests/jasmine/spec_makers | |
parent | 8ff01378c9e0207f9169b81966a51def645b6a51 (diff) |
Update to MediaWiki 1.20.2
this update includes:
* adjusted Arch Linux skin
* updated FluxBBAuthPlugin
* patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'tests/jasmine/spec_makers')
-rw-r--r-- | tests/jasmine/spec_makers/makeJqueryMsgSpec.php | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/jasmine/spec_makers/makeJqueryMsgSpec.php b/tests/jasmine/spec_makers/makeJqueryMsgSpec.php index 1ac8dcba..840da96a 100644 --- a/tests/jasmine/spec_makers/makeJqueryMsgSpec.php +++ b/tests/jasmine/spec_makers/makeJqueryMsgSpec.php @@ -8,13 +8,13 @@ * which can be used with the JasmineBDD framework. This specification can then be used by simply including it into * the SpecRunner.html file. * - * This is similar to Michael Dale (mdale@mediawiki.org)'s parser tests, except that it doesn't look up the + * This is similar to Michael Dale (mdale@mediawiki.org)'s parser tests, except that it doesn't look up the * API results while doing the test, so the Jasmine run is much faster(at the cost of being out of date in rare * circumstances. But mostly the parsing that we are doing in Javascript doesn't change much.) * - */ + */ -$maintenanceDir = dirname( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) ) . '/maintenance'; +$maintenanceDir = dirname( dirname( dirname( __DIR__ ) ) ) . '/maintenance'; require( "$maintenanceDir/Maintenance.php" ); @@ -51,26 +51,22 @@ class MakeLanguageSpec extends Maintenance { private function getMessagesAndTests() { $messages = array(); $tests = array(); - $wfMsgExtOptions = array( 'parsemag' ); foreach ( array( 'en', 'fr', 'ar', 'jp', 'zh' ) as $languageCode ) { - $wfMsgExtOptions['language'] = $languageCode; foreach ( self::$keyToTestArgs as $key => $testArgs ) { foreach ($testArgs as $args) { // get the raw template, without any transformations - $template = wfMsgGetKey( $key, /* useDb */ true, $languageCode, /* transform */ false ); + $template = wfMessage( $key )->inLanguage( $languageCode )->plain(); - // get the magic-parsed version with args - $wfMsgExtArgs = array_merge( array( $key, $wfMsgExtOptions ), $args ); - $result = call_user_func_array( 'wfMsgExt', $wfMsgExtArgs ); + $result = wfMessage( $key, $args )->inLanguage( $languageCode )->text(); // record the template, args, language, and expected result - // fake multiple languages by flattening them together + // fake multiple languages by flattening them together $langKey = $languageCode . '_' . $key; $messages[ $langKey ] = $template; - $tests[] = array( + $tests[] = array( 'name' => $languageCode . " " . $key . " " . join( ",", $args ), 'key' => $langKey, - 'args' => $args, + 'args' => $args, 'result' => $result, 'lang' => $languageCode ); |