mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 07:34:22 +00:00
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:
parent
94ec268cb8
commit
a5c334fdbc
|
@ -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 )
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue