Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
ENGCOM-4487: 429 - Test coverage: nonExistentCart #444
Browse files Browse the repository at this point in the history
 - Merge Pull Request #444 from magento/graphql-ce:429-test-coverage-nonExistentCart
 - Merged commits:
   1. 990a373
   2. 4550597
   3. 350d1f8
  • Loading branch information
magento-engcom-team committed Mar 12, 2019
2 parents 9d231d1 + 350d1f8 commit 95e2303
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,26 @@ public function testSetBillingAddressIfCustomerIsNotOwnerOfAddress()
$this->graphQlQuery($query, [], '', $this->getHeaderMap('customer2@search.example.com'));
}

/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @expectedException \Exception
* @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testSetBillingAddressOnNonExistentCart()
{
$maskedQuoteId = 'non_existent_masked_id';
$query = <<<QUERY
{
cart(cart_id: "$maskedQuoteId") {
items {
id
}
}
}
QUERY;
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
}

/**
* Verify the all the whitelisted fields for a New Address Object
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,26 @@ public function testSetPaymentMethodToAnotherCustomerCart()
$this->graphQlQuery($query, [], '', $this->getHeaderMap('customer2@search.example.com'));
}

/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @expectedException \Exception
* @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testPaymentMethodOnNonExistentCart()
{
$maskedQuoteId = 'non_existent_masked_id';
$query = <<<QUERY
{
cart(cart_id: "$maskedQuoteId") {
items {
id
}
}
}
QUERY;
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
}

/**
* @param string $maskedQuoteId
* @param string $methodCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,25 @@ public function testSetBillingAddressFromAddressBook()
$this->graphQlQuery($query);
}

/**
* @expectedException \Exception
* @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testSetBillingAddressOnNonExistentCart()
{
$maskedQuoteId = 'non_existent_masked_id';
$query = <<<QUERY
{
cart(cart_id: "$maskedQuoteId") {
items {
id
}
}
}
QUERY;
$this->graphQlQuery($query);
}

/**
* Verify the all the whitelisted fields for a New Address Object
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,25 @@ public function testSetPaymentMethodToCustomerCart()
$this->graphQlQuery($query);
}

/**
* @expectedException \Exception
* @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testSetPaymentOnNonExistentCart()
{
$maskedQuoteId = 'non_existent_masked_id';
$query = <<<QUERY
{
cart(cart_id: "$maskedQuoteId") {
items {
id
}
}
}
QUERY;
$this->graphQlQuery($query);
}

/**
* @param string $maskedQuoteId
* @param string $methodCode
Expand Down

0 comments on commit 95e2303

Please sign in to comment.