Remove $this->setService( 'UserOptionsLookup', ... ) in tests

The mocked service UserOptionsLookup is already injected via contructor
to Hooks.

Change-Id: I013aa6f62bd50802889a0037721ba06902d1a18e
This commit is contained in:
Fomafix 2024-03-04 20:04:02 +00:00
parent 6b3c480f02
commit c3df98cff6

View file

@ -39,7 +39,6 @@ class HookTest extends MediaWikiIntegrationTestCase {
] ); ] );
$userOptionsLookup = $this->createMock( UserOptionsLookup::class ); $userOptionsLookup = $this->createMock( UserOptionsLookup::class );
$userOptionsLookup->method( 'getOption' )->willReturn( true ); $userOptionsLookup->method( 'getOption' )->willReturn( true );
$this->setService( 'UserOptionsLookup', $userOptionsLookup );
$out = $this->getMockOutputPage(); $out = $this->getMockOutputPage();
$out->method( 'getModules' )->willReturn( [] ); $out->method( 'getModules' )->willReturn( [] );
@ -87,7 +86,6 @@ class HookTest extends MediaWikiIntegrationTestCase {
$out->method( 'getModules' )->willReturn( $module ? [ $module ] : [] ); $out->method( 'getModules' )->willReturn( $module ? [ $module ] : [] );
$userOptionsLookup = $this->createMock( UserOptionsLookup::class ); $userOptionsLookup = $this->createMock( UserOptionsLookup::class );
$userOptionsLookup->method( 'getOption' )->willReturn( true ); $userOptionsLookup->method( 'getOption' )->willReturn( true );
$this->setService( 'UserOptionsLookup', $userOptionsLookup );
if ( $gadget && !ExtensionRegistry::getInstance()->isLoaded( 'Gadgets' ) ) { if ( $gadget && !ExtensionRegistry::getInstance()->isLoaded( 'Gadgets' ) ) {
$this->markTestSkipped( 'Skipped as Gadgets extension is not available' ); $this->markTestSkipped( 'Skipped as Gadgets extension is not available' );