mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
Use $this->getServiceContainer() in test cases
Change-Id: Ic03f4d692720cd9810c44700f7bf27d1cf07d26d
This commit is contained in:
parent
56d8a8df55
commit
c58f9234fc
|
@ -19,7 +19,6 @@
|
|||
* @ingroup extensions
|
||||
*/
|
||||
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls;
|
||||
use Popups\PopupsContext;
|
||||
use Popups\PopupsGadgetsIntegration;
|
||||
|
@ -50,7 +49,7 @@ class PopupsContextTest extends MediaWikiIntegrationTestCase {
|
|||
$integration->method( 'conflictsWithNavPopupsGadget' )
|
||||
->willReturn( false );
|
||||
}
|
||||
$services = MediaWikiServices::getInstance();
|
||||
$services = $this->getServiceContainer();
|
||||
return new PopupsContext(
|
||||
$config,
|
||||
$registry,
|
||||
|
@ -121,7 +120,7 @@ class PopupsContextTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
$context = $this->getContext();
|
||||
$user = $this->getMutableTestUser()->getUser();
|
||||
$userOptionsManager = MediaWikiServices::getInstance()->getUserOptionsManager();
|
||||
$userOptionsManager = $this->getServiceContainer()->getUserOptionsManager();
|
||||
$userOptionsManager->setOption( $user, PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME, $optIn );
|
||||
$this->assertSame( $expected,
|
||||
$context->shouldSendModuleToUser( $user ),
|
||||
|
|
Loading…
Reference in a new issue