$this->assertNoViolation();
}
+
+ /**
+ * @dataProvider provideCheckTypes
+ */
+ public function testEmptyHostIsNotValid($checkType, $violation)
+ {
+ $this->validator->validate(
+ 'foo@bar.fr@',
+ new Email(array(
+ 'message' => 'myMessage',
+ $checkType => true,
+ ))
+ );
+
+ $this
+ ->buildViolation('myMessage')
+ ->setParameter('{{ value }}', '"foo@bar.fr@"')
+ ->setCode($violation)
+ ->assertRaised();
+ }
+
+ public function provideCheckTypes()
+ {
+ return array(
+ array('checkMX', Email::MX_CHECK_FAILED_ERROR),
+ array('checkHost', Email::HOST_CHECK_FAILED_ERROR),
+ );
+ }
}