forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENGCOM-5220: magento#681: [Test coverage] missed or empty 'cart_id' i…
…n cart operations magento#711 - Merge Pull Request magento/graphql-ce#711 from sergiy-v/graphql-ce:681-missed-cart-id-in-cart-operations - Merged commits: 1. a7bdee7
- Loading branch information
Showing
10 changed files
with
640 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
namespace Magento\GraphQl\Quote\Customer; | ||
|
||
use Exception; | ||
use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId; | ||
use Magento\Integration\Api\CustomerTokenServiceInterface; | ||
use Magento\TestFramework\Helper\Bootstrap; | ||
|
@@ -94,10 +95,41 @@ public function testGetAnotherCustomerCart() | |
$this->graphQlQuery($query, [], '', $this->getHeaderMap('[email protected]')); | ||
} | ||
|
||
/** | ||
* @magentoApiDataFixture Magento/Customer/_files/customer.php | ||
* @expectedException Exception | ||
* @expectedExceptionMessage Required parameter "cart_id" is missing | ||
*/ | ||
public function testGetCartIfCartIdIsEmpty() | ||
{ | ||
$maskedQuoteId = ''; | ||
$query = $this->getQuery($maskedQuoteId); | ||
|
||
$this->graphQlQuery($query, [], '', $this->getHeaderMap()); | ||
} | ||
|
||
/** | ||
* @magentoApiDataFixture Magento/Customer/_files/customer.php | ||
* @expectedException Exception | ||
* @expectedExceptionMessage Field "cart" argument "cart_id" of type "String!" is required but not provided. | ||
*/ | ||
public function testGetCartIfCartIdIsMissed() | ||
{ | ||
$query = <<<QUERY | ||
{ | ||
cart { | ||
} | ||
} | ||
QUERY; | ||
|
||
$this->graphQlQuery($query, [], '', $this->getHeaderMap()); | ||
} | ||
|
||
/** | ||
* @magentoApiDataFixture Magento/Customer/_files/customer.php | ||
* | ||
* @expectedException \Exception | ||
* @expectedException Exception | ||
* @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id" | ||
*/ | ||
public function testGetNonExistentCart() | ||
|
@@ -113,7 +145,7 @@ public function testGetNonExistentCart() | |
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php | ||
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/make_cart_inactive.php | ||
* | ||
* @expectedException \Exception | ||
* @expectedException Exception | ||
* @expectedExceptionMessage Current user does not have an active cart. | ||
*/ | ||
public function testGetInactiveCart() | ||
|
@@ -145,7 +177,7 @@ public function testGetCartWithNotDefaultStore() | |
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php | ||
* @magentoApiDataFixture Magento/Store/_files/second_store.php | ||
* | ||
* @expectedException \Exception | ||
* @expectedException Exception | ||
* @expectedExceptionMessage Wrong store code specified for cart | ||
*/ | ||
public function testGetCartWithWrongStore() | ||
|
@@ -162,7 +194,7 @@ public function testGetCartWithWrongStore() | |
/** | ||
* @magentoApiDataFixture Magento/Checkout/_files/active_quote_customer_not_default_store.php | ||
* | ||
* @expectedException \Exception | ||
* @expectedException Exception | ||
* @expectedExceptionMessage Requested store is not found | ||
*/ | ||
public function testGetCartWithNotExistingStore() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.