createHookContainer( $hooks ); // in case any of the LanguageNameUtils hooks are being used $langNameUtils = $this->getDummyLanguageNameUtils( [ 'hookContainer' => $hookContainer ] ); $options += [ 'forceRecache' => false, 'manualRecache' => false, 'ExtensionMessagesFiles' => [], 'MessagesDirs' => [], 'TranslationAliasesDirs' => [], ]; $lc = $this->getMockBuilder( LocalisationCache::class ) ->setConstructorArgs( [ new ServiceOptions( LocalisationCache::CONSTRUCTOR_OPTIONS, $options ), new LCStoreDB( [] ), new NullLogger, [], $langNameUtils, $hookContainer ] ) ->onlyMethods( [ 'getMessagesDirs' ] ) ->getMock(); $lc->method( 'getMessagesDirs' ) ->willReturn( [ MW_INSTALL_PATH . "/tests/phpunit/data/localisationcache" ] ); return $lc; } }