Skip to content

Commit

Permalink
minor #16196 Fix product review validation's notInRangeMessage (mpysiak)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.12 branch.

Discussion
----------

| Q               | A
|-----------------|-----
| Branch?         | 1.12 
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | #16193 
| License         | MIT

Fixes build error with symfony/validator 6.4.7


Commits
-------
  Fix product review validation's notInRangeMessage
  • Loading branch information
Rafikooo committed Apr 30, 2024
2 parents 053c49e + 79e6409 commit 10ced44
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 14 deletions.
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 @@ -118,7 +118,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 @@ -120,8 +120,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 10ced44

Please sign in to comment.