-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Email validator checkMX constraint - disable in test environment #16819
Comments
In my opinion the methods doing these calls should be moved to something that can be injected. |
If I were you, I would: 1). check if the expression above is correct. I'm not very familiar with its syntax, so there could be some small silly mistake that makes it invalid (like maybe it should be enclosed in quotes). The way I would check this is: add a |
Thanks @SoboLAN - Yes, it's for functional testing. Personally I don't like polluting the validation.yml with environment specific conditional expressions. Same goes for swapping in a whole new validation.yml file. Kind of ugly fix as you say. Could the Symfony framework component or the Validator component have some kind of Regarding manipulating this parameter via accessing the container - no idea how to do this if you could provide any pointers to get me started that would be appreciated. |
@iltar Where would you recommend a MXChecker as you've proposed move to? It doesn't look like anything else in the validator component does anything like that. I'm on board for the inhibit_external (not convinced on naming) strategy. |
This issue will be remedied by #18181 and should be closed when it is merged. |
This PR was merged into the 3.1-dev branch. Discussion ---------- [PhpUnitBridge] Mock DNS functions | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16819 | License | MIT | Doc PR | - Commits ------- 0b31285 [PhpUnitBridge] Mock DNS functions
When running test suites, I don't want to rely on an internet connection. However, I have defined the
checkMX
constraint on various email fields, and this does a remote DNS lookup to perform the validation.Should it not be possible to tell the validator that for the test environment any remote DNS calls should be skipped? Currently some of my tests fail when there is no connectivity due to the MX lookup failing.
I have tried using expression syntax in the validation but this does not appear to work
Any thoughts?
The text was updated successfully, but these errors were encountered: