private SalesChannelContextServiceInterface
$contextService;
protected function setUp(): void
{ $this->ids =
new TestDataCollection();
$this->currencyRepository =
$this->
getContainer()->
get('currency.repository'
);
$this->contextService =
$this->
getContainer()->
get(SalesChannelContextService::
class);
} public function testRequestSalesChannelCurrency(): void
{ $this->
createTestSalesChannel();
$resolver =
$this->
getContainer()->
get(SalesChannelRequestContextResolver::
class);
$phpunit =
$this;
$currencyId =
$this->
getCurrencyId('USD'
);
$request =
new Request();
$request->attributes->
set(PlatformRequest::ATTRIBUTE_SALES_CHANNEL_ID,
$this->ids->
get('sales-channel'
));
$request->attributes->
set(SalesChannelRequest::ATTRIBUTE_DOMAIN_CURRENCY_ID,
$currencyId);
$request->attributes->
set(PlatformRequest::ATTRIBUTE_ROUTE_SCOPE,
['store-api'
]);
/** @var EventDispatcher $dispatcher */