Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Validator] add domain test for windows check dns #27559

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

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
Revert "change example.com to another-example.com"
This reverts commit 2a5abc4.
  • Loading branch information
oliviervangest committed Jun 11, 2018
commit 9cec87b0bdf72d0296a037817cfa8eeb901a58b1
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ public function testStrict()
*/
public function testDnsChecks($type, $violation)
{
DnsMock::withMockedHosts(array('another-example.com' => array(array('type' => $violation ? false : $type))));
DnsMock::withMockedHosts(array('example.com' => array(array('type' => $violation ? false : $type))));

$constraint = new Email(array(
'message' => 'myMessage',
'MX' === $type ? 'checkMX' : 'checkHost' => true,
));

$this->validator->validate('foo@another-example.com', $constraint);
$this->validator->validate('[email protected]', $constraint);

if (!$violation) {
$this->assertNoViolation();
} else {
$this->buildViolation('myMessage')
->setParameter('{{ value }}', '"foo@another-example.com"')
->setParameter('{{ value }}', '"[email protected]"')
->setCode($violation)
->assertRaised();
}
Expand Down