X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fcache%2FLocalisationCacheTest.php;h=af1ff86515e6e9bb86806d3d99a28a48b3f0bf7f;hp=39526fb9c738055fbd9524ac9059675d2e0eaf20;hb=101493a70783b15656daa0686d404ac1a7a6976b;hpb=2b5f468efa2d57f0e5437d7e5a8e4ae674485460 diff --git a/tests/phpunit/includes/cache/LocalisationCacheTest.php b/tests/phpunit/includes/cache/LocalisationCacheTest.php index 39526fb9c7..af1ff86515 100644 --- a/tests/phpunit/includes/cache/LocalisationCacheTest.php +++ b/tests/phpunit/includes/cache/LocalisationCacheTest.php @@ -1,7 +1,6 @@ createMock( LanguageNameUtils::class ); - $mockLangNameUtils->method( 'isValidBuiltInCode' )->will( $this->returnCallback( - function ( $code ) { - // Copy-paste, but it's only one line - return (bool)preg_match( '/^[a-z0-9-]{2,}$/', $code ); - } - ) ); - $mockLangNameUtils->method( 'isSupportedLanguage' )->will( $this->returnCallback( - function ( $code ) { - return in_array( $code, [ - 'ar', - 'arz', - 'ba', - 'de', - 'en', - 'ksh', - 'ru', - ] ); - } - ) ); - $mockLangNameUtils->method( 'getMessagesFileName' )->will( $this->returnCallback( - function ( $code ) { - global $IP; - $code = str_replace( '-', '_', ucfirst( $code ) ); - return "$IP/languages/messages/Messages$code.php"; - } - ) ); - $mockLangNameUtils->expects( $this->never() )->method( $this->anythingBut( - 'isValidBuiltInCode', 'isSupportedLanguage', 'getMessagesFileName' - ) ); - $lc = $this->getMockBuilder( LocalisationCache::class ) ->setConstructorArgs( [ - new ServiceOptions( LocalisationCache::$constructorOptions, [ + new ServiceOptions( LocalisationCache::CONSTRUCTOR_OPTIONS, [ 'forceRecache' => false, 'manualRecache' => false, 'ExtensionMessagesFiles' => [], 'MessagesDirs' => [], ] ), new LCStoreDB( [] ), - new NullLogger, - [], - $mockLangNameUtils + new NullLogger ] ) ->setMethods( [ 'getMessagesDirs' ] ) ->getMock();