mediawiki.test: Fix mw.config interaction with wgScriptPath
authorKrinkle <krinkle@users.mediawiki.org>
Sun, 28 Aug 2011 22:04:49 +0000 (22:04 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Sun, 28 Aug 2011 22:04:49 +0000 (22:04 +0000)
commitc4f70e144adc247f88ce6c9d502a7cfcf8e1b959
tree60b93f26512752bf6d17f70915926cb922b7fd33
parent12e00d6eb903b0b1c611948e20e4ed5713035fc1
mediawiki.test: Fix mw.config interaction with wgScriptPath
* Previously the the load test in mediawiki.test.js failed when ran within a wiki because the regex to extract the path from window.location doesn't know take in account stuff like wiki-pagenames (which can contain slashes in the title) or action paths and what not.

Changes:
* Use wgScriptPath from mw.config when available in the mediawiki.test.js (instead of the regexed window.location)
* To make sure the test still works in the static /qunit/index.html (where wgScriptPath is obviously not defined by php), re-introduced the removed regex extration hack. This also allows other modules to use wgScriptPath and removes the hack from the test suite to where it is needed and keeps the test module clean. When the on-wiki testrunner is ready and added to core, /qunit/index.html can be nuked all together including this hack. Now the hack is at least part of what-is-to-be-removed.
* Added save/restore for manipulated mw.config vars in mediawiki.util.test.js (to avoid it from messing up the real wgScriptPath for other tests)
* Fixed load path to 'data/' in testrunner.js as well
tests/qunit/data/testrunner.js
tests/qunit/index.html
tests/qunit/suites/resources/mediawiki/mediawiki.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js