QUnit.module( 'mediawiki', QUnit.newMwEnvironment( {
setup: function () {
- // Messages used in multiple tests
- mw.messages.set( {
- 'other-message': 'Other Message',
- 'mediawiki-test-pagetriage-del-talk-page-notify-summary': 'Notifying author of deletion nomination for [[$1]]',
- 'gender-plural-msg': '{{GENDER:$1|he|she|they}} {{PLURAL:$2|is|are}} awesome',
- 'grammar-msg': 'Przeszukaj {{GRAMMAR:grammar_case_foo|{{SITENAME}}}}',
- 'formatnum-msg': '{{formatnum:$1}}',
- 'int-msg': 'Some {{int:other-message}}',
- 'mediawiki-test-version-entrypoints-index-php': '[https://www.mediawiki.org/wiki/Manual:index.php index.php]',
- 'external-link-replace': 'Foo [$1 bar]'
- } );
-
- mw.config.set( {
- wgArticlePath: '/wiki/$1',
-
- // For formatnum tests
- wgUserLanguage: 'en'
- } );
-
specialCharactersPageName = '"Who" wants to be a millionaire & live on \'Exotic Island\'?';
+ },
+ config: {
+ wgArticlePath: '/wiki/$1',
+
+ // For formatnum tests
+ wgUserLanguage: 'en'
+ },
+ // Messages used in multiple tests
+ messages: {
+ 'other-message': 'Other Message',
+ 'mediawiki-test-pagetriage-del-talk-page-notify-summary': 'Notifying author of deletion nomination for [[$1]]',
+ 'gender-plural-msg': '{{GENDER:$1|he|she|they}} {{PLURAL:$2|is|are}} awesome',
+ 'grammar-msg': 'Przeszukaj {{GRAMMAR:grammar_case_foo|{{SITENAME}}}}',
+ 'formatnum-msg': '{{formatnum:$1}}',
+ 'int-msg': 'Some {{int:other-message}}',
+ 'mediawiki-test-version-entrypoints-index-php': '[https://www.mediawiki.org/wiki/Manual:index.php index.php]',
+ 'external-link-replace': 'Foo [$1 bar]'
}
} ) );
assert.strictEqual( window.$j, window.jQuery, '$j alias to jQuery' );
this.restoreWarnings();
+ // window.mw and window.mediaWiki are not deprecated, but for some reason
+ // PhantomJS is triggerring the accessors on all mw.* properties in this test,
+ // and with that lots of unrelated deprecation notices.
+ this.suppressWarnings();
assert.ok( window.mediaWiki, 'mediaWiki defined' );
assert.ok( window.mw, 'mw defined' );
assert.strictEqual( window.mw, window.mediaWiki, 'mw alias to mediaWiki' );
+ this.restoreWarnings();
} );
QUnit.test( 'mw.Map', 28, function ( assert ) {