public function getTranslatedLabelTests($by, $using, $translatedId, $translatedLabel, $expectedResult)
{
$this->arguments['translate'] = ['by' => $by, 'using' => $using, 'prefix' => 'somePrefix.'];
$this->injectDependenciesIntoViewHelper($this->viewHelper);
$mockTranslator = $this->createMock(\Neos\Flow\I18n\Translator::class);
if ($by === 'label') {
$mockTranslator->expects($this->once())->method('translateByOriginalLabel')->will($this->returnCallback(function ($label) use($translatedLabel) {
return $translatedLabel !== null ? $translatedLabel : $label;
}));
} else {
$mockTranslator->expects($this->once())->method('translateById')->will($this->returnValue($translatedId));
}
$this->inject($this->viewHelper, 'translator', $mockTranslator);
$actualResult = $this->viewHelper->_call('getTranslatedLabel', 'someValue', 'Some label');
$this->assertSame($expectedResult, $actualResult);
}