Inital commit for unit test configuration

This commit is contained in:
Manish Verma
2018-09-05 12:36:46 +05:30
committed by Manish Verma
parent 2f0796e954
commit e0436b7757
252 changed files with 3219 additions and 1631 deletions

View File

@@ -18,6 +18,13 @@ class DNSCheckValidation implements EmailValidation
* @var InvalidEmail
*/
private $error;
public function __construct()
{
if (!extension_loaded('intl')) {
throw new \LogicException(sprintf('The %s class requires the Intl extension.', __CLASS__));
}
}
public function isValid($email, EmailLexer $emailLexer)
{
@@ -44,7 +51,11 @@ class DNSCheckValidation implements EmailValidation
protected function checkDNS($host)
{
$host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46), '.') . '.';
$variant = INTL_IDNA_VARIANT_2003;
if ( defined('INTL_IDNA_VARIANT_UTS46') ) {
$variant = INTL_IDNA_VARIANT_UTS46;
}
$host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, $variant), '.') . '.';
$Aresult = true;
$MXresult = checkdnsrr($host, 'MX');