PromotionDiscountDefinition example

private WriteContext $context;

    private PromotionDefinition $promotionDefinition;

    private PromotionDiscountDefinition $discountDefinition;

    protected function setUp(): void
    {
        $this->context = WriteContext::createFromContext(Context::createDefaultContext());

        $this->promotionDefinition = new PromotionDefinition();
        $this->discountDefinition = new PromotionDiscountDefinition();
    }

    /** * This test verifies that we do not allow a promotion that has * been configured to use a code, but the code is empty. * So we set useCodes to TRUE, provide an empty code and expect * a corresponding exception. * * @group promotions */
    public function testPromotionCodeRequired(): void
    {
Home | Imprint | This part of the site doesn't use cookies.