Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d973eb1

Browse filesBrowse files
apetitpafabpot
apetitpa
authored andcommitted
Add a test to prevent future regressions
1 parent 6f24b05 commit d973eb1
Copy full SHA for d973eb1

File tree

1 file changed

+28
-0
lines changed
Filter options

1 file changed

+28
-0
lines changed

‎src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.