public function getLocalizedFilenameReturnsCorrectlyLocalizedFilename()
{
$desiredLocale = new I18n\Locale('en_GB');
$parentLocale = new I18n\Locale('en');
$localeChain = ['en_GB' => $desiredLocale, 'en' => $parentLocale];
$filename = 'vfs://Foo/Bar/Public/images/foobar.png';
$expectedFilename = 'vfs://Foo/Bar/Public/images/foobar.en.png';
mkdir(dirname($filename), 0777, true);
file_put_contents($expectedFilename, 'FooBar');
$service = $this->getMockBuilder(I18n\Service::class)->setMethods(['getLocaleChain'])->getMock();
$service->expects($this->atLeastOnce())->method('getLocaleChain')->with($desiredLocale)->will($this->returnValue($localeChain));
list($result, ) = $service->getLocalizedFilename($filename, $desiredLocale);
$this->assertEquals($expectedFilename, $result);
}