diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php index f71ec9ad8521..36f5d7028fb0 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php @@ -50,8 +50,6 @@ public function testAddProductIfQuantityIsNotAvailable() * @magentoApiDataFixture Magento/Catalog/_files/products.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php * @magentoConfigFixture default_store cataloginventory/item_options/max_sale_qty 5 - * @expectedException \Exception - * @expectedExceptionMessage The most you may purchase is 5. */ public function testAddMoreProductsThatAllowed() { @@ -59,6 +57,10 @@ public function testAddMoreProductsThatAllowed() $quantity = 7; $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); + $this->expectExceptionMessageRegExp( + '/The most you may purchase is 5|The requested qty exceeds the maximum qty allowed in shopping cart/' + ); + $query = $this->getQuery($maskedQuoteId, $sku, $quantity); $this->graphQlMutation($query); }