Skip to content

Commit

Permalink
Update product review validation's notInRangeMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
diimpp committed Nov 25, 2022
1 parent ffcb3d2 commit 6bed76a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 14 deletions.
3 changes: 3 additions & 0 deletions UPGRADE-1.13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UPGRADE FROM `v1.12.X` TO `v1.13.0`

1. Validation translation key `sylius.review.rating.range` was renamed to `sylius.review.rating.not_in_range`.
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ Feature: Product review validation
And I leave a comment "This book made me sad, but plot was fine.", titled "Not good, not bad" as "example@example.com"
And I rate it with 6 points
And I try to add it
Then I should be notified that rate must be an integer in the range 1-5
Then I should be notified that rating must be between 1 and 5
6 changes: 3 additions & 3 deletions src/Sylius/Behat/Context/Api/Shop/ProductReviewContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,11 @@ public function iShouldBeNotifiedThatThisEmailIsAlreadyRegistered(): void
}

/**
* @Then I should be notified that rate must be an integer in the range 1-5
* @Then I should be notified that rating must be between 1 and 5
*/
public function iShouldBeNotifiedThatRateMustBeAnIntegerInTheRange15(): void
public function iShouldBeNotifiedThatRatingMustBeBetween1And5(): void
{
$this->assertViolation('Review rating must be an integer in the range 1-5.', 'rating');
$this->assertViolation('Review rating must be between 1 and 5.', 'rating');
}

private function hasReviewsWithTitles(array $titles): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
<constraint name="Range">
<option name="min">1</option>
<option name="max">5</option>
<option name="minMessage">sylius.review.rating.range</option>
<option name="maxMessage">sylius.review.rating.range</option>
<option name="notInRangeMessage">sylius.review.rating.range</option>
<option name="notInRangeMessage">sylius.review.rating.not_in_range</option>
<option name="groups">sylius</option>
</constraint>
</property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ sylius:
review:
author:
not_blank: Bitte geben Sie Ihre E-Mail-Adresse ein.
rating:
range: Bewertung muss eine Ganzzahl im Bereich 1-5 sein.
taxon_image:
file:
max_size: Das Bild ist zu groß - {{ size }}{{ suffix }}. Maximal zulässige Größe {{ limit }}{{ suffix }}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ sylius:
review:
author:
not_blank: Bitte geben Sie Ihre E-Mail-Adresse ein.
rating:
range: Bewertung muss eine Ganzzahl im Bereich 1-5 sein.
taxon_image:
file:
max_size: Das Bild ist zu groß - {{ size }}{{ suffix }}. Maximal zulässige Größe {{ limit }}{{ suffix }}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ sylius:
author:
not_blank: Please enter your email.
rating:
range: Review rating must be an integer in the range 1-5.
not_in_range: Review rating must be between {{ min }} and {{ max }}.
taxon_image:
file:
max_size: The image is too big - {{ size }}{{ suffix }}. Maximum allowed size is {{ limit }}{{ suffix }}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ sylius:
review:
author:
not_blank: Veuillez saisir votre adresse email.
rating:
range: La note de l'avis doit être un entier entre 1 et 5.
taxon_image:
file:
max_size: L'image est trop grande - {{ size }}{{ suffix }}. La taille maximum autorisée est de {{ limit }}{{ suffix }}.
Expand Down

0 comments on commit 6bed76a

Please sign in to comment.