QUnit.module( 'mediawiki.jqueryMsg', QUnit.newMwEnvironment( {
setup: function () {
- this.orgMwLangauge = mw.language;
- mw.language = $.extend( true, {}, this.orgMwLangauge );
+ this.originalMwLanguage = mw.language;
// Messages that are reused in multiple tests
mw.messages.set( {
} );
},
teardown: function () {
- mw.language = this.orgMwLangauge;
+ mw.language = this.originalMwLanguage;
}
} ) );
return;
}
mw.messages.set(test.message );
- mw.config.set( 'wgUserLanguage', test.lang ) ;
+ mw.config.set( 'wgUserLanguage', test.lang );
var parser = new mw.jqueryMsg.parser( { language: langClass } );
assert.equal(
parser.parse( test.integer ? 'formatnum-msg-int' : 'formatnum-msg',
assert.htmlEqual(
formatParse( 'jquerymsg-italics-with-link' ),
- 'An <i>italicized <a title="link" href="' + mw.html.escape( mw.util.wikiGetlink( 'link' ) ) + '">wiki-link</i>',
+ 'An <i>italicized <a title="link" href="' + mw.html.escape( mw.util.getUrl( 'link' ) ) + '">wiki-link</i>',
'Italics with link inside in parse mode'
);
mw.messages.set( 'jquerymsg-script-link-msg', '<script>[[Foo|bar]]</script>' );
assert.htmlEqual(
formatParse( 'jquerymsg-script-link-msg' ),
- '<script><a title="Foo" href="' + mw.html.escape( mw.util.wikiGetlink( 'Foo' ) ) + '">bar</a></script>',
+ '<script><a title="Foo" href="' + mw.html.escape( mw.util.getUrl( 'Foo' ) ) + '">bar</a></script>',
'Script tag text is escaped because that element is not allowed, but link inside is still HTML'
);