createPromotionsAndOrder example

private SalesChannelContext $salesChannelContext;

    protected function setUp(): void
    {
        $this->ids = new TestDataCollection();
        $this->connection = $this->getContainer()->get(Connection::class);
        $this->salesChannelContext = $this->createSalesChannelContext();
    }

    public function testPromotionRedemptionUpdaterUpdateViaIndexer(): void
    {
        $this->createPromotionsAndOrder();

        $updater = $this->getContainer()->get(PromotionRedemptionUpdater::class);
        $updater->update([$this->ids->get('voucherA')$this->ids->get('voucherB')], Context::createDefaultContext());

        $this->assertUpdatedCounts();
    }

    public function testPromotionRedemptionUpdaterUpdateViaOrderPlacedEvent(): void
    {
        $this->createPromotionsAndOrder();

        
Home | Imprint | This part of the site doesn't use cookies.