resourceloader: Move 'site' and 'user' logic to makeModuleResponse
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 15 Sep 2016 04:01:09 +0000 (21:01 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 16 Sep 2016 01:32:07 +0000 (18:32 -0700)
commit09e1b91756686bb55dc1521d9f53b6ef23a09c01
treeb74ee790df9a9efc019d13116e00096160afac4a
parentba49dbd66ef2c61c7c42ceb172c901ea0dbf5927
resourceloader: Move 'site' and 'user' logic to makeModuleResponse

* Keep this out of makeLoaderImplementScript() to keep it more generic
  and to simplify future refactoring.

* Remove now-broken test case that asserted that the output varies
  by global debug mode.

* Make the test responsible for wrapping in XmlJsCode. Previously
  this magically happened because the module name was "user" in the
  last test case.

* Make makeLoaderImplementScript protected. It's not used anywhere
  outside ResourceLoader and we should keep it that way.

Test plan:
* Verify output unchanged:
  - load.php?modules=user&only=scripts&user=Admin (raw code)
  - load.php?modules=user&user=Admin (implement with unwrapped string)
  - load.php?modules=jquery.client (implement with closure)

Change-Id: I527d01926fb6e4ce68c931695d830cdb9ceb608c
includes/resourceloader/ResourceLoader.php
resources/src/mediawiki/mediawiki.js
tests/phpunit/includes/resourceloader/ResourceLoaderTest.php