You are here

public function EmailValidatorTest::getInvalidEmailsWithErrors in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php \Egulias\Tests\EmailValidator\EmailValidatorTest::getInvalidEmailsWithErrors()

File

vendor/egulias/email-validator/tests/egulias/Tests/EmailValidator/EmailValidatorTest.php, line 139

Class

EmailValidatorTest

Namespace

Egulias\Tests\EmailValidator

Code

public function getInvalidEmailsWithErrors() {
  return array(
    array(
      EmailValidator::ERR_NOLOCALPART,
      '@example.co.uk',
    ),
    array(
      EmailValidator::ERR_NODOMAIN,
      'example@',
    ),
    array(
      EmailValidator::ERR_DOMAINHYPHENEND,
      'example@example-.co.uk',
    ),
    array(
      EmailValidator::ERR_DOMAINHYPHENEND,
      'example@example-',
    ),
    array(
      EmailValidator::ERR_CONSECUTIVEATS,
      'example@@example.co.uk',
    ),
    array(
      EmailValidator::ERR_CONSECUTIVEDOTS,
      'example..example@example.co.uk',
    ),
    array(
      EmailValidator::ERR_CONSECUTIVEDOTS,
      'example@example..co.uk',
    ),
    array(
      EmailValidator::ERR_EXPECTING_ATEXT,
      '<fabien_potencier>@example.fr',
    ),
    array(
      EmailValidator::ERR_DOT_START,
      '.example@localhost',
    ),
    array(
      EmailValidator::ERR_DOT_START,
      'example@.localhost',
    ),
    array(
      EmailValidator::ERR_DOT_END,
      'example@localhost.',
    ),
    array(
      EmailValidator::ERR_DOT_END,
      'example.@example.co.uk',
    ),
    array(
      EmailValidator::ERR_UNCLOSEDCOMMENT,
      '(example@localhost',
    ),
    array(
      EmailValidator::ERR_UNCLOSEDQUOTEDSTR,
      '"example@localhost',
    ),
    array(
      EmailValidator::ERR_EXPECTING_ATEXT,
      'exa"mple@localhost',
    ),
    //This was the original. But atext is not allowed after \n

    //array(EmailValidator::ERR_EXPECTING_ATEXT, "exampl\ne@example.co.uk"),
    array(
      EmailValidator::ERR_ATEXT_AFTER_CFWS,
      "exampl\ne@example.co.uk",
    ),
    array(
      EmailValidator::ERR_EXPECTING_DTEXT,
      "example@[[]",
    ),
    array(
      EmailValidator::ERR_ATEXT_AFTER_CFWS,
      "exampl\te@example.co.uk",
    ),
    array(
      EmailValidator::ERR_CR_NO_LF,
      "example@exa\rmple.co.uk",
    ),
    array(
      EmailValidator::ERR_CR_NO_LF,
      "example@[\r]",
    ),
    array(
      EmailValidator::ERR_CR_NO_LF,
      "exam\rple@example.co.uk",
    ),
  );
}