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

[Behat][Promotion] Fixed discount on items in price range #4457

Merged

Conversation

Zales0123
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
License MIT
Doc PR

Based on #4391 and #4453, highly recommend to wait with merge for everybody good health ;)

@Zales0123 Zales0123 changed the title [Behat][Promotion] Fixed discount on items in range [Behat][Promotion] Fixed discount on items in price range Mar 10, 2016
@michalmarcinkowski michalmarcinkowski added this to the v0.18.0 milestone Mar 10, 2016
And it gives "€30.00" off on every product classified as "Mugs"
When I add 2 products "PHP Mug" to the cart
Then theirs price should be decreased by "€40.00"
Then my cart total should be "€0.00"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double Then

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 but this is bug in scenario from here and I'm gonna fix it there ;)

*
* @return bool
*/
private function isInvalidConfiguration(array $configuration)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better name isConfigured?

@Zales0123 Zales0123 force-pushed the fixed-discount-on-items-in-range branch from bda5a4e to c5ecc2e Compare March 15, 2016 12:58
->filter([$item1, $item2, $item3], ['filters' => ['price_range' => ['min' => 1000, 'max' => 10000]]])
->shouldReturn([$item2])
;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about edge cases? How does it work for items priced at 1000 or 10000?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 added

@Zales0123 Zales0123 force-pushed the fixed-discount-on-items-in-range branch 2 times, most recently from 1cb3a74 to 836f2dd Compare March 15, 2016 16:05
->filter([$item1, $item2], ['filters' => ['price_range' => ['min' => 1000, 'max' => 10000]]])
->shouldReturn([$item2])
;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the cases where only min is specified in the configuration? I see logic for that, but don't see any specs covering it...

Btw. what will happen if I will only specify the max in the config? It looks like there will be some unwanted result 💥

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lchrusciel
Copy link
Member

👍

pjedrzejewski pushed a commit that referenced this pull request Mar 17, 2016
[Behat][Promotion] Fixed discount on items in price range
@pjedrzejewski pjedrzejewski merged commit af95afd into Sylius:master Mar 17, 2016
@pjedrzejewski
Copy link
Member

Thank you Mateusz! 👍

@Zales0123 Zales0123 deleted the fixed-discount-on-items-in-range branch October 28, 2016 13:41
pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
…-in-range

[Behat][Promotion] Fixed discount on items in price range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants