private PromotionEntity
$promotion;
/**
* @var MockObject&SalesChannelContext
*/
private SalesChannelContext
$salesChannelContext;
protected function setUp(): void
{ $this->promotion =
new PromotionEntity();
$this->promotion->
setId('PR-1'
);
$this->promotion->
setUseCodes(false
);
$this->promotion->
setUseIndividualCodes(false
);
$this->promotion->
setUseSetGroups(false
);
$this->salesChannelContext =
$this->
getMockBuilder(SalesChannelContext::
class)->
disableOriginalConstructor()->
getMock();
$context =
$this->
getMockBuilder(Context::
class)->
disableOriginalConstructor()->
getMock();
$this->salesChannelContext->
method('getContext'
)->
willReturn($context);
} /**
* This test verifies that we have the correct payload in our
* discount line item. this is used to identify the promotion behind it.
* It's also used as reference to individual codes that get marked as redeemed
* in the event subscriber, when the order is created.
*
* @group promotions
*/