setTrackingCodes example


    public function testIfMatches(
        OrderTrackingCodeRule $rule,
        array $trackingCodeData,
        bool $expected
    ): void {
        $orderDeliveryCollection = new OrderDeliveryCollection();
        $orderDelivery = new OrderDeliveryEntity();
        $orderDelivery->setId(Uuid::randomHex());
        $orderDelivery->setTrackingCodes($trackingCodeData);
        $orderDeliveryCollection->add($orderDelivery);

        $order = new OrderEntity();
        $order->setDeliveries($orderDeliveryCollection);

        $cart = $this->createMock(Cart::class);
        $context = $this->createMock(SalesChannelContext::class);

        $match = $rule->match(new FlowRuleScope(
            $order,
            $cart,
            
Home | Imprint | This part of the site doesn't use cookies.