public function ExceptionThrower::calculateRates in Commerce Shipping 8.2
Calculates rates for the given shipment.
Parameters
\Drupal\commerce_shipping\Entity\ShipmentInterface $shipment: The shipment.
Return value
\Drupal\commerce_shipping\ShippingRate[] The rates.
Overrides ShippingMethodInterface::calculateRates
File
- tests/
modules/ commerce_shipping_test/ src/ Plugin/ Commerce/ ShippingMethod/ ExceptionThrower.php, line 21
Class
- ExceptionThrower
- Provides a shipping method that throws an exception when calculating rates.
Namespace
Drupal\commerce_shipping_test\Plugin\Commerce\ShippingMethodCode
public function calculateRates(ShipmentInterface $shipment) {
throw new \Exception('Simulate a shipping plugin that throws an exception when calculating rates.');
}