Skip to content

Commit

Permalink
Test coverage: Add product to Cart with wrong cart hash
Browse files Browse the repository at this point in the history
  • Loading branch information
XxXgeoXxX committed Mar 11, 2019
1 parent e51df41 commit 07c0fbe
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,45 @@ public function testAddProductIfQuantityIsNotAvailable()
}
}
}
QUERY;

$this->graphQlQuery($query);
}

/**
* @magentoApiDataFixture Magento/Catalog/_files/products.php
* @expectedException \Exception
* @expectedExceptionMessage Could not find a cart with ID "wrong_cart_hash"
*/
public function testAddProductWithWrongCartHash()
{
$sku = 'simple';
$qty = 1;

$maskedQuoteId = 'wrong_cart_hash';

$query = <<<QUERY
mutation {
addSimpleProductsToCart(
input: {
cart_id: "{$maskedQuoteId}"
cartItems: [
{
data: {
qty: $qty
sku: "$sku"
}
}
]
}
) {
cart {
items {
qty
}
}
}
}
QUERY;

$this->graphQlQuery($query);
Expand Down

0 comments on commit 07c0fbe

Please sign in to comment.