File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -159,4 +159,32 @@ public function testHostnameIsProperlyParsed()
159159
160160 $ this ->assertNoViolation ();
161161 }
162+
163+ public function getCheckTypes ()
164+ {
165+ return array (
166+ array ('checkMX ' , Email::MX_CHECK_FAILED_ERROR ),
167+ array ('checkHost ' , Email::HOST_CHECK_FAILED_ERROR ),
168+ );
169+ }
170+
171+ /**
172+ * @dataProvider getCheckTypes
173+ */
174+ public function testEmptyHostIsNotValid ($ checkType , $ violation )
175+ {
176+ $ this ->validator ->validate (
177+ 'foo@bar.fr@ ' ,
178+ new Email (array (
179+ 'message ' => 'myMessage ' ,
180+ $ checkType => true ,
181+ ))
182+ );
183+
184+ $ this
185+ ->buildViolation ('myMessage ' )
186+ ->setParameter ('{{ value }} ' , '"foo@bar.fr@" ' )
187+ ->setCode ($ violation )
188+ ->assertRaised ();
189+ }
162190}
You can’t perform that action at this time.
0 commit comments