-
Notifications
You must be signed in to change notification settings - Fork 154
Add API functional tests for ApplyCouponToCart functionality #558
Add API functional tests for ApplyCouponToCart functionality #558
Conversation
/** | ||
* @var CouponResourceInterface | ||
*/ | ||
protected $couponResource; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, check and remove all of unused dependencies like this
* @param string $sku | ||
* @throws \Exception | ||
*/ | ||
private function excludeProductPerCoupon(string $couponCode, string $sku) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move this set-up
to fixture file (with rollback)?
Example:
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*/
'test_order_with_simple_product_without_address', | ||
'reserved_order_id' | ||
); | ||
$maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we can avoid manipulating with QuoteResource (etc..) if we will reuse current fixtures
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*/
@dmytro-ch |
…to-cart # Conflicts: # dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CouponTest.php
Hello @naydav, Thank you! |
Hi @dmytro-ch, thank you for your contribution! |
Description (*)
Fixed Issues (if relevant)
Manual testing scenarios (*)
N/A
Contribution checklist (*)