ShippingMethodPriceExceptionHandler example

/** * @covers \Shopware\Core\Checkout\Shipping\Aggregate\ShippingMethodPrice\ShippingMethodPriceExceptionHandler * * @internal */
#[Package('checkout')] class ShippingMethodPriceExceptionHandlerTest extends TestCase
{
    public function testPriority(): void
    {
        $handler = new ShippingMethodPriceExceptionHandler();

        static::assertSame(0, $handler->getPriority());
    }

    public function testSqlExceptionHandled(): void
    {
        $message = 'An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry \'foo-bar\' for key \'shipping_method_price.uniq.shipping_method_quantity_start\'';

        $e = new \Exception($message);

        $handler = new ShippingMethodPriceExceptionHandler();
        
Home | Imprint | This part of the site doesn't use cookies.