Adding skip for validation test, for DNS servers that reply for non-existant domains.

This commit is contained in:
mark_story 2009-10-31 14:48:37 -04:00
parent 76019513e1
commit 6b616b7171

View file

@ -1584,6 +1584,10 @@ class ValidationTest extends CakeTestCase {
* @return void * @return void
*/ */
function testEmailDeep() { function testEmailDeep() {
$found = gethostbynamel('example.abcd');
if ($this->skipIf($found, 'Your DNS service responds for non-existant domains, skipping deep email checks. %s')) {
return;
}
$this->assertTrue(Validation::email('abc.efg@cakephp.org', true)); $this->assertTrue(Validation::email('abc.efg@cakephp.org', true));
$this->assertFalse(Validation::email('abc.efg@caphpkeinvalid.com', true)); $this->assertFalse(Validation::email('abc.efg@caphpkeinvalid.com', true));
$this->assertFalse(Validation::email('abc@example.abcd', true)); $this->assertFalse(Validation::email('abc@example.abcd', true));