Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#9858 Fix for promotion of 100 percent with coupon #9919

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
@@ -0,0 +1,18 @@
@applying_promotion_coupon
Feature: Applying promotion coupon
In order to pay proper amount after using the promotion coupon
As a Visitor
I want to have promotion coupon's discounts applied to my cart when it is a promotion that provides 100% discount

Background:
Given the store operates on a single channel in "United States"
And the store has a product "PHP T-Shirt" priced at "$100.00"
And the store has promotion "Christmas sale" with coupon "SANTA2016"
And this promotion gives "100%" discount to every order

@ui
Scenario: Receiving full percentage discount for my cart
When I add product "PHP T-Shirt" to the cart
And I use coupon with code "SANTA2016"
Then my cart total should be "$0.00"
And my discount should be "-$100.00"
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ public function execute(PromotionSubjectInterface $subject, array $configuration
*/
protected function isConfigurationValid(array $configuration): void
{
if (!isset($configuration['percentage']) || !is_float($configuration['percentage'])) {
throw new \InvalidArgumentException('"percentage" must be set and must be a float.');
}
Assert::keyExists($configuration, 'percentage');
Assert::greaterThan($configuration['percentage'], 0);
Assert::lessThanEq($configuration['percentage'], 1);
}

/**
Expand Down