diff --git a/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php b/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php index e9e3a6e..e72fde4 100644 --- a/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php +++ b/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php @@ -150,6 +150,16 @@ public function testValidEmailsWithWarningsCheck($warnings, $email) $this->assertEquals($warnings, $this->validator->getWarnings()); } + /** + * @dataProvider getInvalidEmailsWithWarnings + */ + public function testInvalidEmailsWithDnsCheckAndStrictMode($warnings, $email) + { + $this->assertFalse($this->validator->isValid($email, true, true)); + + $this->assertEquals($warnings, $this->validator->getWarnings()); + } + public function getInvalidEmailsWithWarnings() { return array( @@ -301,14 +311,15 @@ public function getInvalidEmailsWithWarnings() 'parttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpart'. 'toolonglocalparttoolonglocalparttoolonglocalparttoolonglocalpar' ), + array( + array( + EmailValidator::DNSWARN_NO_RECORD, + ), + 'test@test' + ), ); } - public function testInvalidEmailsWithDNSAndStrict() - { - $this->assertFalse($this->validator->isValid('test@test', true, true)); - } - public function testInvalidEmailsWithStrict() { $this->assertFalse($this->validator->isValid('"test"@test', false, true));