Compare commits

...

8 Commits

Author SHA1 Message Date
Eduardo Gulias Davis af9417f765 #40 - require latest lexer 2015-01-04 23:42:32 +01:00
Eduardo Gulias Davis ab0bcfb424 Merge pull request #44 from egulias/kbond-semicolon-fail
From #43 - Kbond semicolon fail
2015-01-04 17:36:06 +01:00
Eduardo Gulias Davis 833b3e7924 #41 - Semicolon in domain 2015-01-04 17:28:58 +01:00
Eduardo Gulias Davis fec1609458 Update tests for DNSCheck 2015-01-04 17:24:36 +01:00
Eduardo Gulias Davis add559b99c Add PhpStorm logo
Thanks for supporting!
2015-01-04 17:03:09 +01:00
Kevin Bond 19e390d863 added failing test for email with semi-colon in domain 2014-12-18 11:00:21 -05:00
Eduardo Gulias Davis 5320c26b38 Merge pull request #39 from shakaran/patch-1
Rename Ohter.md to Other.md
2014-11-30 19:03:44 +01:00
Ángel Guzmán Maeso 3b6ab3bcd5 Rename Ohter.md to Other.md
Fix small filename typo.
2014-11-30 02:17:28 +01:00
6 changed files with 81 additions and 47 deletions
+4 -1
View File
@@ -1,6 +1,9 @@
EmailValidator [![Build Status](https://travis-ci.org/egulias/EmailValidator.png?branch=master)](https://travis-ci.org/egulias/EmailValidator) [![Coverage Status](https://coveralls.io/repos/egulias/EmailValidator/badge.png?branch=master)](https://coveralls.io/r/egulias/EmailValidator?branch=master) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/22ba6692-9c02-42e5-a65d-1c5696bfffc6/small.png)](https://insight.sensiolabs.com/projects/22ba6692-9c02-42e5-a65d-1c5696bfffc6)[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/egulias/EmailValidator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/egulias/EmailValidator/?branch=master)
#EmailValidator#
[![Build Status](https://travis-ci.org/egulias/EmailValidator.png?branch=master)](https://travis-ci.org/egulias/EmailValidator) [![Coverage Status](https://coveralls.io/repos/egulias/EmailValidator/badge.png?branch=master)](https://coveralls.io/r/egulias/EmailValidator?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/egulias/EmailValidator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/egulias/EmailValidator/?branch=master) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/22ba6692-9c02-42e5-a65d-1c5696bfffc6/small.png)](https://insight.sensiolabs.com/projects/22ba6692-9c02-42e5-a65d-1c5696bfffc6)
=============================
With the help of
![Powered by PhpStorm](https://www.jetbrains.com/phpstorm/documentation/docs/logo_phpstorm.png)
##Installation##
Run the command below to install via Composer
+1 -1
View File
@@ -15,7 +15,7 @@
},
"require": {
"php": ">= 5.3.3",
"doctrine/lexer": "dev-master"
"doctrine/lexer": "~1.0"
},
"require-dev" : {
"satooshi/php-coveralls": "dev-master"
Generated
+45 -42
View File
@@ -4,11 +4,11 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "7c82c4ea93186526be106a60ea69f6f1",
"hash": "9e9dff0cc08c7292600453e681201e13",
"packages": [
{
"name": "doctrine/lexer",
"version": "dev-master",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
@@ -269,17 +269,17 @@
},
{
"name": "symfony/config",
"version": "v2.5.6",
"version": "v2.6.1",
"target-dir": "Symfony/Component/Config",
"source": {
"type": "git",
"url": "https://github.com/symfony/Config.git",
"reference": "0316364bfebc8b080077c731a99f189341476bd7"
"reference": "84c0c150c1520995f09ea9e47e817068b353cb0f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Config/zipball/0316364bfebc8b080077c731a99f189341476bd7",
"reference": "0316364bfebc8b080077c731a99f189341476bd7",
"url": "https://api.github.com/repos/symfony/Config/zipball/84c0c150c1520995f09ea9e47e817068b353cb0f",
"reference": "84c0c150c1520995f09ea9e47e817068b353cb0f",
"shasum": ""
},
"require": {
@@ -289,7 +289,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
"dev-master": "2.6-dev"
}
},
"autoload": {
@@ -313,21 +313,21 @@
],
"description": "Symfony Config Component",
"homepage": "http://symfony.com",
"time": "2014-09-23 05:25:11"
"time": "2014-12-02 20:19:20"
},
{
"name": "symfony/console",
"version": "v2.5.6",
"version": "v2.6.1",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console.git",
"reference": "6f177fca24200a5b97aef5ce7a5c98124a0f0db0"
"reference": "ef825fd9f809d275926547c9e57cbf14968793e8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Console/zipball/6f177fca24200a5b97aef5ce7a5c98124a0f0db0",
"reference": "6f177fca24200a5b97aef5ce7a5c98124a0f0db0",
"url": "https://api.github.com/repos/symfony/Console/zipball/ef825fd9f809d275926547c9e57cbf14968793e8",
"reference": "ef825fd9f809d275926547c9e57cbf14968793e8",
"shasum": ""
},
"require": {
@@ -335,16 +335,18 @@
},
"require-dev": {
"psr/log": "~1.0",
"symfony/event-dispatcher": "~2.1"
"symfony/event-dispatcher": "~2.1",
"symfony/process": "~2.1"
},
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": ""
"symfony/event-dispatcher": "",
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
"dev-master": "2.6-dev"
}
},
"autoload": {
@@ -368,21 +370,21 @@
],
"description": "Symfony Console Component",
"homepage": "http://symfony.com",
"time": "2014-10-05 13:57:04"
"time": "2014-12-02 20:19:20"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.5.6",
"version": "v2.6.1",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
"reference": "804eb28dbbfba9ffdab21fe2066744906cea2212"
"reference": "720fe9bca893df7ad1b4546649473b5afddf0216"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/804eb28dbbfba9ffdab21fe2066744906cea2212",
"reference": "804eb28dbbfba9ffdab21fe2066744906cea2212",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/720fe9bca893df7ad1b4546649473b5afddf0216",
"reference": "720fe9bca893df7ad1b4546649473b5afddf0216",
"shasum": ""
},
"require": {
@@ -391,7 +393,8 @@
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.0",
"symfony/dependency-injection": "~2.0,<2.6.0",
"symfony/dependency-injection": "~2.6",
"symfony/expression-language": "~2.6",
"symfony/stopwatch": "~2.2"
},
"suggest": {
@@ -401,7 +404,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
"dev-master": "2.6-dev"
}
},
"autoload": {
@@ -425,21 +428,21 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
"time": "2014-10-01 15:43:05"
"time": "2014-12-02 20:19:20"
},
{
"name": "symfony/filesystem",
"version": "v2.5.6",
"version": "v2.6.1",
"target-dir": "Symfony/Component/Filesystem",
"source": {
"type": "git",
"url": "https://github.com/symfony/Filesystem.git",
"reference": "4e62fab0060a826561c78b665925b37c870c45f5"
"reference": "ff6efc95256cb33031933729e68b01d720b5436b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Filesystem/zipball/4e62fab0060a826561c78b665925b37c870c45f5",
"reference": "4e62fab0060a826561c78b665925b37c870c45f5",
"url": "https://api.github.com/repos/symfony/Filesystem/zipball/ff6efc95256cb33031933729e68b01d720b5436b",
"reference": "ff6efc95256cb33031933729e68b01d720b5436b",
"shasum": ""
},
"require": {
@@ -448,7 +451,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
"dev-master": "2.6-dev"
}
},
"autoload": {
@@ -472,21 +475,21 @@
],
"description": "Symfony Filesystem Component",
"homepage": "http://symfony.com",
"time": "2014-09-22 09:14:18"
"time": "2014-12-02 20:19:20"
},
{
"name": "symfony/stopwatch",
"version": "v2.5.6",
"version": "v2.6.1",
"target-dir": "Symfony/Component/Stopwatch",
"source": {
"type": "git",
"url": "https://github.com/symfony/Stopwatch.git",
"reference": "9f8a33a24f2378c0ec5f372a8d50b2d43069c050"
"reference": "261abd360cfb6ac65ea93ffd82073e2011d034fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Stopwatch/zipball/9f8a33a24f2378c0ec5f372a8d50b2d43069c050",
"reference": "9f8a33a24f2378c0ec5f372a8d50b2d43069c050",
"url": "https://api.github.com/repos/symfony/Stopwatch/zipball/261abd360cfb6ac65ea93ffd82073e2011d034fc",
"reference": "261abd360cfb6ac65ea93ffd82073e2011d034fc",
"shasum": ""
},
"require": {
@@ -495,7 +498,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
"dev-master": "2.6-dev"
}
},
"autoload": {
@@ -519,21 +522,21 @@
],
"description": "Symfony Stopwatch Component",
"homepage": "http://symfony.com",
"time": "2014-09-22 09:14:18"
"time": "2014-12-02 20:19:20"
},
{
"name": "symfony/yaml",
"version": "v2.5.6",
"version": "v2.6.1",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
"reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726"
"reference": "3346fc090a3eb6b53d408db2903b241af51dcb20"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/2d9f527449cabfa8543dd7fa3a466d6ae83d6726",
"reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20",
"reference": "3346fc090a3eb6b53d408db2903b241af51dcb20",
"shasum": ""
},
"require": {
@@ -542,7 +545,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
"dev-master": "2.6-dev"
}
},
"autoload": {
@@ -566,16 +569,16 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
"time": "2014-10-01 05:50:18"
"time": "2014-12-02 20:19:20"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"doctrine/lexer": 20,
"satooshi/php-coveralls": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">= 5.3.3"
},
@@ -104,6 +104,10 @@ class DomainPart extends Parser
{
$domain = '';
do {
if ($this->lexer->token['type'] === EmailLexer::S_SEMICOLON) {
throw new \InvalidArgumentException('ERR_EXPECTING_ATEXT');
}
$prev = $this->lexer->getPrevious();
if ($this->lexer->token['type'] === EmailLexer::S_SLASH) {
@@ -108,6 +108,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase
array('test@iana.org \r\n\r\n'),
array('test@iana.org \r\n\r\n '),
array('test@iana/icann.org'),
array('test@foo;bar.com'),
);
}
@@ -173,13 +174,32 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase
public function getInvalidEmailsWithWarnings()
{
return array(
array(array( EmailValidator::DEPREC_CFWS_NEAR_AT,), 'example @example.co.uk'),
array(array( EmailValidator::DEPREC_CFWS_NEAR_AT,), 'example@ example.co.uk'),
array(array( EmailValidator::CFWS_COMMENT,), 'example@example(examplecomment).co.uk'),
array(
array(
EmailValidator::DEPREC_CFWS_NEAR_AT,
EmailValidator::DNSWARN_NO_RECORD
),
'example @example.co.uk'
),
array(
array(
EmailValidator::DEPREC_CFWS_NEAR_AT,
EmailValidator::DNSWARN_NO_RECORD
),
'example@ example.co.uk'
),
array(
array(
EmailValidator::CFWS_COMMENT,
EmailValidator::DNSWARN_NO_RECORD
),
'example@example(examplecomment).co.uk'
),
array(
array(
EmailValidator::CFWS_COMMENT,
EmailValidator::DEPREC_CFWS_NEAR_AT,
EmailValidator::DNSWARN_NO_RECORD,
),
'example(examplecomment)@example.co.uk'
),
@@ -187,6 +207,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase
array(
EmailValidator::RFC5321_QUOTEDSTRING,
EmailValidator::CFWS_FWS,
EmailValidator::DNSWARN_NO_RECORD,
),
"\"\t\"@example.co.uk"
),
@@ -194,6 +215,7 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase
array(
EmailValidator::RFC5321_QUOTEDSTRING,
EmailValidator::CFWS_FWS,
EmailValidator::DNSWARN_NO_RECORD
),
"\"\r\"@example.co.uk"
),
@@ -285,12 +307,14 @@ class EmailValidatorTest extends \PHPUnit_Framework_TestCase
array(
array(
EmailValidator::RFC5321_QUOTEDSTRING,
EmailValidator::DNSWARN_NO_RECORD
),
'"example"@example.co.uk'
),
array(
array(
EmailValidator::RFC5322_LOCAL_TOOLONG,
EmailValidator::DNSWARN_NO_RECORD
),
'too_long_localpart_too_long_localpart_too_long_localpart_too_long_localpart@example.co.uk'
),