%PDF- %PDF-
Direktori : /www/varak.net/wiki.varak.net/extensions/MobileFrontend/tests/node-qunit/utils/ |
Current File : /www/varak.net/wiki.varak.net/extensions/MobileFrontend/tests/node-qunit/utils/mockMediaWiki.js |
/* eslint-disable camelcase */ var namespaceIDs = { special: -1, talk: 1, user_talk: 3, project: 4, project_talk: 5 }; /* eslint-enable camelcase */ module.exports = function newMockMediaWiki() { var config = { wgNamespaceIds: namespaceIDs }; return { config: { get: function ( name ) { return config[name]; }, set: function ( name, val ) { config[name] = val; } }, html: { escape: function ( str ) { return str.replace( /['"<>&]/g, function ( char ) { switch ( char ) { case '\'': return '''; case '"': return '"'; case '<': return '<'; case '>': return '>'; case '&': return '&'; } } ); } }, log: { deprecate: function () {} }, msg: function ( id ) { return id; }, now: Date.now.bind( Date ), template: { get: function () {} }, user: {}, util: { getUrl: function ( title ) { return title; } }, loader: { using: function () {} } }; };