Mock ExtensionRegistry in MathTest

The test doesn't need to depend on what extensions are
available/installed. Also pass the test config more explicitly to
ServiceOptions.

Needed-by: I0a04c82250582fed7a66c1e10868d9b4f3823a28
Change-Id: Id2587fe7d31fcd652c26e5dd0a8cfcae3161efcc
This commit is contained in:
Daimona Eaytoy 2023-07-15 19:11:18 +02:00
parent 94ec268cb8
commit a5c334fdbc

View file

@ -23,12 +23,13 @@ class MathTest extends MediaWikiUnitTestCase {
] );
$services = new MediaWikiServices( $config );
$services->defineService( 'Math.Config',
static function ( MediaWikiServices $services ){
return new MathConfig(
new ServiceOptions(
MathConfig::CONSTRUCTOR_OPTIONS,
$services->get( 'BootstrapConfig' ) ),
ExtensionRegistry::getInstance()
function ( MediaWikiServices $services ) use ( $config ) {
return new MathConfig(
new ServiceOptions(
MathConfig::CONSTRUCTOR_OPTIONS,
$config
),
$this->createMock( ExtensionRegistry::class )
);
}
);