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
[API] Seeing promotions total in cart #11971
Conversation
arti0090
commented
Oct 28, 2020
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
License | MIT |
src/Sylius/Behat/Resources/config/suites/api/promotion/receiving_discount.yml
Outdated
Show resolved
Hide resolved
4b95a89
to
f431fca
Compare
f431fca
to
f13e06e
Compare
{ | ||
Assert::same($this->responseChecker->getValue($this->client->getResponse(), 'orderPromotionTotal'), 0); | ||
if ($this->sharedStorage->has('cart_token')) { |
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.
Does this if makes sense? I would assume that cart_token is always set (as we always have cart declared).
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.
Yes, because it depends on context where it was started. If steps are all in checkout then they are using $this->client->getResponse()
but some steps from cartContext are finished here and those steps are using sharedStorage
.
); | ||
|
||
Assert::same($discount, (int) $discountTotal); | ||
} else { |
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.
Instead of else, can we make early return?
Thanks, @arti0090! 🥇 |