$context =
$contextService->
get(new SalesChannelContextServiceParameters(TestDefaults::SALES_CHANNEL,
$newtoken));
$lineItem =
(new ProductLineItemFactory(new PriceDefinitionFactory()))->
create(['id' =>
$this->productId, 'referencedId' =>
$this->productId
],
$context);
$cartService =
$this->
getContainer()->
get(CartService::
class);
$cart =
$cartService->
getCart($context->
getToken(),
$context);
$cart =
$cartService->
add($cart,
$lineItem,
$context);
$this->
setDomainForSalesChannel('http://shopware.local', Defaults::LANGUAGE_SYSTEM,
$context->
getContext());
$systemConfigService =
$this->
getContainer()->
get(SystemConfigService::
class);
$systemConfigService->
set('core.basicInformation.email', 'test@example.org'
);
/** @var EventDispatcher $dispatcher */
$dispatcher =
$this->
getContainer()->
get('event_dispatcher'
);
$phpunit =
$this;
$eventDidRun = false;
$listenerClosure =
function DMailSentEvent
$event) use (&
$eventDidRun,
$phpunit): void
{