class TranslatorTest extends TestCase
{ /**
* @dataProvider getCatalogueRequestProvider
*/
public function testGetCatalogueIsCachedCorrectly(?string
$snippetSetId, ?Request
$request, ?string
$expectedCacheKey, ?string
$injectSalesChannelId = null
): void
{ $decorated =
$this->
createMock(SymfonyTranslator::
class);
$originCatalogue =
new MessageCatalogue('en-GB',
[ 'messages' =>
[ 'global.title' => 'This is a title',
'global.summary' => 'This is a summary',
],
]);
$decorated->
expects(static::
any())->
method('getCatalogue'
)->
with('en-GB'
)->
willReturn($originCatalogue);
$decorated->
expects(static::
any())->
method('getLocale'
)->
willReturn('en-GB'
);
$requestStack =
new RequestStack();