Closed
Description
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
email:
- Email:
message: The email {{ value }} does not seem to be valid.
checkMX: @=parameter('kernel.environment') == 'test' ? false : true
Any thoughts?