Commit Graph

87 Commits

Author SHA1 Message Date
Eduardo Gulias Davis 8e526a57c1 Message-id validator (#290)
* scafolding for MessageID validation

* Improve domain valid tokens

* Improved EmailParser to remove leaked logic. User of lexer recorder within parsers.

* MessageIDParser passing tests.

* change left for right, which is the right one

* psaml errors

* Better naming

* comments are not allowed in IDLeft for message-id

* Suppress psalm inheritance over tokens and dependencies

* Update src/Parser.php

Co-authored-by: Alexander M. Turek <me@derrabus.de>

* Update src/Parser.php

Co-authored-by: Alexander M. Turek <me@derrabus.de>

* improve parser from comments

Co-authored-by: Alexander M. Turek <me@derrabus.de>
2021-03-06 18:29:10 +01:00
Alies Lapatsin 451b438902 Use a safe way to execute dns_get_record (v3) (#286)
* #256 Bypass a PHP warning generated by @dns_get_record

The idea is to create a custom error handler for dns_get_record(), call dns_get_record and then restore the original error handler.
This way we can catch PHP warnings (e.g. "Warning: dns_get_record(): DNS Query failed" or "dns_get_record(): A temporary server error occurred." [ErrorException])

* #256 Make `UnableToGetDNSRecord` reason more testable

* #256 Suppress psalm’s false-positive error

see https://github.com/vimeo/psalm/issues/5134#issuecomment-782937791

* #256 Speed up tests: start from previously failed

* #256 Suppress psalm’s false-positive error

We don’t have a control over AbstractLexer and can’t specify array shape in this parent class
2021-02-28 15:27:57 +01:00
Chun-Sheng, Li 04cad1a5ec Fix testing class name and namespaces (#284) 2021-02-07 15:42:56 +01:00
Eduardo Gulias Davis a7b66b5d5a Improve test coverage. Exclude Reasons from coverage, they are simple implementations of interface with only informative data 2021-01-17 15:57:03 +01:00
Eduardo Gulias Davis 819aa5500a removing no longer useful performance tests 2020-12-28 11:55:44 +01:00
Eduardo Gulias Davis f72a7a1854 Port @vajexal #278 2020-12-28 10:40:47 +01:00
Eduardo Gulias Davis f00f069e3b 0 is an invalid email 2020-12-05 23:44:36 +01:00
Eduardo Gulias Davis cc695081fd new home for extra validations 2020-12-05 23:34:35 +01:00
Eduardo Gulias Davis 3dc66acf64 domain improvements over UTF16 and invalid ascii chars 2020-12-05 22:58:13 +01:00
Eduardo Gulias Davis c41a7b491e Improve domain validation 2020-11-14 23:29:20 +01:00
Eduardo Gulias Davis a7a69112df complaying to RFC1035 about domain names 2020-11-10 11:22:03 +01:00
Eduardo Gulias Davis e00a58a84e Label and domain name validation 2020-11-10 11:08:53 +01:00
Eduardo Gulias Davis c0e4efaeb0 Separation of tests to prepare for strictier domain validation 2020-11-10 10:36:53 +01:00
Eduardo Gulias Davis 35c9db913f Port of comma in domain and README improvement. 2020-11-08 15:57:58 +01:00
Eduardo Gulias Davis cbe0d20542 fix #188, adding TLD warnings 2020-10-10 18:47:15 +02:00
Eduardo Gulias Davis 5455d688c1 Part extraction improvement with lexer recording. Reported in #181 2020-10-03 17:37:57 +02:00
Eduardo Gulias Davis ce879d7d10 Fix Space after end of domain. #217 2020-09-26 16:30:00 +02:00
Eduardo Gulias Davis e272a25e47 Test spoof emails in travis 2020-09-20 15:24:15 +02:00
Eduardo Gulias Davis 2964536758 Added tests for valid plus warnings 2020-09-20 15:20:50 +02:00
Eduardo Gulias Davis 9512ac0b19 Psalm errors plus test for MultipleErrors reason and improved multi validation tests 2020-09-19 16:17:03 +02:00
Eduardo Gulias Davis 8405dcde01 Added invalidtaion for backslash in domain literal and test data 2020-09-19 15:50:04 +02:00
Eduardo Gulias Davis 0ba6f87f8e Adjusting duplicated methods 2020-09-12 16:25:24 +02:00
Eduardo Gulias Davis 781b1c8509 Clean-up 2020-09-12 15:59:52 +02:00
Eduardo Gulias Davis b3a339b998 Evaluate comma ',' in domain part 2020-09-12 15:53:55 +02:00
Eduardo Gulias Davis e2e234c4d8 merging from master, folder structure change 2020-08-30 15:59:42 +02:00
BenHarris 840d5603eb Reimplement DNSCheckValidation (#250)
* Reimplement DNSCheckValidation to utilise get_dns_record and extend support for detection of Null MX records (RFC7505) and reserved, mDNS and private namespaces (RFC2606 & RFC6762)

* Change valid email tests to use github.com instead of example.com as example.com now (correctly) fails the tests due to the Null MX case

* Tweak to pass CI psalm issue

* Encapsulate dns check code. Simplify local and reserved domain checks. Switch test domain

* Set PHPDoc return type

* Use strict comparisons
2020-08-08 23:28:19 +02:00
Simon Schaufelberger cfa3d44471 Move files in typical src and tests folder (#242)
* Move files in typical src and tests folder

* Fix psalm error
2020-06-16 22:11:17 +02:00
Eduardo Gulias Davis 4505d2060a New home for all the tests. Fixed namespaces (#105)
* New home for all the tests. Fixed namespaces

* small code improvement

* Skipping tests failing only in Travis
2016-05-15 11:46:59 +02:00
Eduardo Gulias Davis 68aae522c4 moving code around 2016-05-07 15:45:55 +02:00
Roland Franssen 102932acf8 check for escaped double quotes in local part (#102) 2016-05-02 16:04:07 +02:00
Eduardo Gulias Davis 8c4213336e #64 NoRFCWarnings (#99) 2016-04-30 16:04:24 +02:00
Eduardo Gulias Davis 6484b80486 DNS validation. Closes #63 (#98) 2016-04-30 14:02:24 +02:00
Eduardo Gulias Davis ed861e1696 RFCValidation strategy, multiple validation (#96)
closes #62
2016-04-30 12:35:17 +02:00
Eduardo Gulias Davis 0f768c989e #62 - Change validation interface 2016-04-30 00:48:07 +02:00
Eduardo Gulias Davis fa5dd33577 #66 custom warnings (#94)
close #66 custom warnings
2016-04-29 01:02:18 +02:00
Eduardo Gulias Davis d29b96ba7c Merge branch 'master' into 60-custom-exceptions
Conflicts:
	src/Egulias/EmailValidator/Parser/DomainPart.php
	src/Egulias/EmailValidator/Parser/LocalPart.php
	src/Egulias/EmailValidator/Parser/Parser.php
	tests/egulias/Tests/EmailValidator/EmailValidatorTest.php
2015-10-12 11:53:11 +02:00
Andrei Sozonov eb1755efbf #80 validate number of closing parenthesis 2015-10-02 12:42:25 +03:00
Eduardo Gulias Davis 4ab34b1c72 CRNoLF 2015-06-26 15:10:20 +02:00
Eduardo Gulias Davis 5f813d9511 unclosed comment 2015-06-26 14:52:06 +02:00
Eduardo Gulias Davis a9d35f2e2c Unclosed quoted string 2015-06-26 14:45:02 +02:00
Eduardo Gulias Davis 76e52cc5ce Domain Hyphened 2015-06-25 22:05:20 +02:00
Eduardo Gulias Davis f69cd9e42f Dot at the end 2015-06-25 22:00:09 +02:00
Eduardo Gulias Davis 7f7734e3d9 ExpectingATEXT 2015-06-25 21:44:05 +02:00
Eduardo Gulias Davis 4acf8db902 Atext after CFWS 2015-06-25 21:20:31 +02:00
Eduardo Gulias Davis 191fd96588 No Domain Part 2015-06-25 21:04:42 +02:00
Eduardo Gulias Davis 0692245d38 NoLocalPart 2015-06-25 20:56:51 +02:00
Eduardo Gulias Davis 94f55b7cc9 Dtext exception and improvement over exception InvalidEmail 2015-06-25 20:50:33 +02:00
Eduardo Gulias Davis 8ca3f0373d Consecutive AT 2015-06-25 20:25:29 +02:00
Eduardo Gulias Davis f4b154c169 Custom exception for dot at start 2015-06-25 20:11:07 +02:00
Eduardo Gulias Davis c383717824 Improve UTF8 detection within the regexp, update tests for non-ascii char, fix #55 2015-04-26 17:38:14 +02:00