callbackLoadShippingMethods example

$shippingMethodRoute = $this->createMock(ShippingMethodRoute::class);

        if ($dontReturnAnyOtherShippingMethod) {
            $shippingMethodRoute
                ->method('load')
                ->withAnyParameters()
                ->willReturnCallback($this->callbackLoadShippingMethodsForAllBlocked(...));
        } else {
            $shippingMethodRoute
                ->method('load')
                ->withAnyParameters()
                ->willReturnCallback($this->callbackLoadShippingMethods(...));
        }

        return $shippingMethodRoute;
    }
}
Home | Imprint | This part of the site doesn't use cookies.