Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #16028 [Currency][Locale][Country] Update intl-based validation a…
…nd cleanup obsolete options (NoResponseMate) This PR was merged into the 1.13 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.13 | | Bug fix? | yes | | New feature? | no | | BC breaks? | no? | | Deprecations? | no | | Related tickets | #14880, #15472 | | License | MIT | Commits ------- ae04f10 [Currency] Add `Currency` constraint to code field c0a77ac [API][Behat] Test currency code validation d524f7a [Addressing] Remove obsolete country code validation 75b2d9e [Locale] Remove obsolete locale code validation bcba0c9 [Currency] Remove obsolete currency code validation
- Loading branch information
Showing
11 changed files
with
111 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
features/currency/managing_currencies/currency_validation.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@managing_currencies | ||
Feature: Currency validation | ||
In order to avoid making mistakes when managing currencies | ||
As an Administrator | ||
I want to be prevented from adding an invalid currency | ||
|
||
Background: | ||
Given I am logged in as an administrator | ||
|
||
@api @no-ui | ||
Scenario: Trying to add currency without code | ||
When I want to add a new currency | ||
And I do not choose a code | ||
And I try to add it | ||
Then I should be notified that a code is required | ||
|
||
@api @no-ui | ||
Scenario: Trying to add a currency with an invalid code | ||
When I want to add a new currency | ||
And I set code to "invalid" | ||
And I try to add it | ||
Then I should be notified that the code is invalid | ||
|
||
@api @no-ui | ||
Scenario: Trying to add a currency with an non-existent code | ||
When I want to add a new currency | ||
And I set code to "B0B" | ||
And I try to add it | ||
Then I should be notified that the code is invalid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/Sylius/Bundle/CurrencyBundle/Resources/translations/validators.en.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/Api/Responses/admin/currency/post_currency_with_invalid_code_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"@context": "\/api\/v2\/contexts\/ConstraintViolationList", | ||
"@type": "ConstraintViolationList", | ||
"hydra:title": "An error occurred", | ||
"hydra:description": "code: This value is not a valid currency code.", | ||
"violations": [ | ||
{ | ||
"propertyPath": "code", | ||
"message": "This value is not a valid currency code.", | ||
"code": @string@ | ||
} | ||
] | ||
} |