X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=tests%2Fphpunit%2FResourceLoaderTestCase.php;h=45cfdbfc612d35f6e3636e1d510072969f115a6d;hb=652e555d26cc49bc98464a3c06116de3aa45140f;hp=8eb1fd509a689dd1c84f765878d7bcf6bd2b7f32;hpb=bae5e1da62aec03349cfdb8025910ced09400966;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/ResourceLoaderTestCase.php b/tests/phpunit/ResourceLoaderTestCase.php index 8eb1fd509a..45cfdbfc61 100644 --- a/tests/phpunit/ResourceLoaderTestCase.php +++ b/tests/phpunit/ResourceLoaderTestCase.php @@ -1,5 +1,6 @@ $options ]; + } + $options += [ + 'lang' => 'en', + 'dir' => 'ltr', + ]; $resourceLoader = new ResourceLoader(); $request = new FauxRequest( [ - 'lang' => $lang, + 'lang' => $options['lang'], 'modules' => 'startup', 'only' => 'scripts', 'skin' => 'vector', @@ -27,7 +37,7 @@ abstract class ResourceLoaderTestCase extends MediaWikiTestCase { ->setConstructorArgs( [ $resourceLoader, $request ] ) ->setMethods( [ 'getDirection' ] ) ->getMock(); - $ctx->method( 'getDirection' )->willReturn( $dir ); + $ctx->method( 'getDirection' )->willReturn( $options['dir'] ); return $ctx; } @@ -140,7 +150,7 @@ class EmptyResourceLoader extends ResourceLoader { // and default registrations are done from ServiceWiring instead. public function __construct( Config $config = null, LoggerInterface $logger = null ) { $this->setLogger( $logger ?: new NullLogger() ); - $this->config = $config ?: ConfigFactory::getDefaultInstance()->makeConfig( 'main' ); + $this->config = $config ?: MediaWikiServices::getInstance()->getMainConfig(); $this->setMessageBlobStore( new MessageBlobStore( $this, $this->getLogger() ) ); } }