protected function getTranslatorInterfaceMock()
{
$that = $this;
$this->translatorMock = $this->getMock('Symfony\\Component\\Translation\\TranslatorInterface');
$this->translatorMock->expects($this->any())->method('trans')->will($this->returnCallback(function ($suffixes) use($that) {
foreach ($that->getLocale() as $value) {
if ($value === 'fre-FR') {
return $suffixes . ' French version';
} elseif ($value === 'eng-GB') {
return $suffixes . ' English version';
} else {
return $suffixes . ' wrong local so we take the default one which is en-GB here';
}
}
}));
return $this->translatorMock;
}