-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Behat][Promotion] Fixed discount promotion scenarios #4199
[Behat][Promotion] Fixed discount promotion scenarios #4199
Conversation
function it_creates_fixed_discount_action_for_promotion( | ||
$actionRepository, | ||
$objectManager, | ||
$sharedStorage, |
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.
Can we have the same order of arguments as in let
?
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.
👍
0f79cc8
to
459ce8e
Compare
$action = $this->testPromotionFactory->createFixedDiscountAction($amount, $currentPromotion); | ||
$this->actionRepository->add($action); | ||
|
||
$this->objectManager->flush(); |
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.
No need to flush
since repository
on add
does persist and flush :)
Ok, after some brainstorm we have some conclusion, how for now it should be done 😄
We believe this concept is the best approach at this moment, but surely it's really big thing to discuss, how these services should be implemented in the perfect Sylius ;) |
459ce8e
to
e7a9b26
Compare
UPDATE: After changing |
public function thereIsPromotion($promotionName) | ||
{ | ||
$promotion = $this->testPromotionFactory->create($promotionName); | ||
$promotion->addChannel($this->sharedStorage->get('channel')); |
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.
How about $this->testPromotionFactory->createForChannel($promotionName, $this->sharedStorage->get('channel'));
?
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.
👍
e7a9b26
to
1152df9
Compare
…arios [Behat][Promotion] Fixed discount promotion scenarios
Thank you Mateusz! 👍 |
…n-scenarios [Behat][Promotion] Fixed discount promotion scenarios
Based on #4170
First portion of new promotion scenarios, for very simple cases - receiving fixed discount without any rules and receiving discount equal to cart items total.