wiki.techinc.nl/tests/phpunit/includes/MockServiceWiring.php
Tim Starling c8f51d1fb7 Use the old HookContainer to set up the post-reset services
HookContainer::salvage() expects to be called immediately after the
object is constructed, and I enforced this expectation by asserting that
$this->handlersByName is empty.

However, MediaWikiServices::resetGlobalInstance() calls
HookContainer::run() in between construction and salvage(). The effect
is that the assertion is hit if any hooks were executed using the old
HookContainer.

So, call onMediaWikiServices() using the old pre-reset HookContainer,
instead of using a partially-constructed HookContainer for this purpose.
Pass the new MediaWikiServices instance as the argument, since that is
the thing that the hook is configuring.

Bug: T263925
Change-Id: I2b462d82c82314b11563a5ba1f02c6fb6d29e608
2020-12-01 13:04:12 +11:00

3 lines
57 B
PHP

<?php
return MediaWikiServicesTest::$mockServiceWiring;