From 7dcc8a5089b0e40b492a1ebf932ee9eaa18f7285 Mon Sep 17 00:00:00 2001 From: Willem Wollebrants Date: Wed, 31 Jan 2018 16:19:05 +0100 Subject: [PATCH 1/2] add test for new emailDNS validator --- tests/Valitron/ValidateTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Valitron/ValidateTest.php b/tests/Valitron/ValidateTest.php index adf296e..d599cb6 100644 --- a/tests/Valitron/ValidateTest.php +++ b/tests/Valitron/ValidateTest.php @@ -560,6 +560,18 @@ class ValidateTest extends BaseTestCase $this->assertFalse($v->validate()); } + public function testEmailDnsValid(){ + $v = new Validator(array('name' => 'Chester Tester', 'email' => 'chester@tester.com')); + $v->rule('emailDNS', 'email'); + $this->assertTrue($v->validate()); + } + + public function testEmailDnsInvalid(){ + $v = new Validator(array('name' => 'Chester Tester', 'email' => 'chester@tester.zyx')); + $v->rule('emailDNS', 'email'); + $this->assertFalse($v->validate()); + } + public function testUrlValid() { $v = new Validator(array('website' => 'http://google.com')); From f8e69683afa1af97a5e6c035dbaf5452c843eb89 Mon Sep 17 00:00:00 2001 From: Willem Wollebrants Date: Wed, 31 Jan 2018 16:20:58 +0100 Subject: [PATCH 2/2] add emailDNS validator to documentation --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0d520fd..bb7a744 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ V::lang('ar'); * `notIn` - Negation of `in` rule (not in array of values) * `ip` - Valid IP address * `email` - Valid email address + * `emailDNS` - Valid email address with active DNS record * `url` - Valid URL * `urlActive` - Valid URL with active DNS record * `alpha` - Alphabetic characters only