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

429 - Test coverage: nonExistentCart #444

Merged
merged 3 commits into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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