Don't trigger MessageBlobStore during tests
authorKunal Mehta <legoktm@gmail.com>
Sun, 29 Mar 2015 04:24:31 +0000 (21:24 -0700)
committerKunal Mehta <legoktm@gmail.com>
Sun, 29 Mar 2015 04:25:25 +0000 (21:25 -0700)
commit4fb5c877f6efb688106069ee914793d8e7a5497e
treeec2b4285345746e28db01485d704849982715d92
parentf2d7596aa65973cec93abac749f311d762179b5f
Don't trigger MessageBlobStore during tests

The test for OutputPage::makeResourceLoaderLink was triggering database
queries through MessageBlobStore even though it doesn't use any
messages.

In bb03d1a8e08 I had made MessageBlobStore a singleton instead of static
functions, however there's no need for it to be one since the class is
stateless. Callers can just create a new MessageBlobStore instance and
call functions upon it. Using getInstance() is now deprecated.

ResourceLoader now has a setMessageBlobStore setter to allow overriding
which MessageBlobStore instance will be used. OutputPageTest uses this
to set a NullMessageBlobStore, which makes no database queries.

Change-Id: Ica7436fb6f1ea59bd445b02527829ab0742c0842
includes/MessageBlobStore.php
includes/cache/LocalisationCache.php
includes/cache/MessageCache.php
includes/installer/DatabaseUpdater.php
includes/resourceloader/ResourceLoader.php
tests/phpunit/includes/OutputPageTest.php