<p dir="auto">When running test suites, I don't want to rely on an internet connection. However, I have defined the <code class="notranslate">checkMX</code> constraint on various email fields, and this does a remote DNS lookup to perform the validation.</p>
<p dir="auto">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.</p>
<p dir="auto">I have tried using expression syntax in the validation but this does not appear to work</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="email:
      - Email:
          message: The email {{ value }} does not seem to be valid.
          checkMX: @=parameter('kernel.environment') == 'test' ? false : true"><pre class="notranslate"><span class="pl-ent">email</span>:
      - <span class="pl-ent">Email</span>:
          <span class="pl-ent">message</span>: <span class="pl-s">The email {{ value }} does not seem to be valid.</span>
          <span class="pl-ent">checkMX</span>: <span class="pl-s">@=parameter('kernel.environment') == 'test' ? false : true</span></pre></div>
<p dir="auto">Any thoughts?</p>
<p dir="auto">stty: standard input: Invalid argument</p>
<p dir="auto">ssh example.com stty -a</p>