Closed LucasLaurens closed 7 months ago
If the PR is accepted, I could create one for documentation.
I also have a question. Do I need to update the snapshots? This would seem normal if this feature is accepted.
I hadn't seen it before. But my PR matches this one exactly. So it doesn't make sense anymore.
Perhaps in the long term, if the intention is to add an expectation on the email, this could be improved with a DNS check.
[!NOTE] I was able to extend an expectation on a personal project where I check for a specific use case the validity of the email according to an RFC and DNS validation.
/** DNS Validation */
$dns = new DNSCheckValidation();
if (
!$dns->isValid(
email: $value,
emailLexer: new \Egulias\EmailValidator\EmailLexer()
)
) {
return false;
}
What:
Description:
This PR adds a toBeEmail() expectation, to validate whether a value is a valid EMAIL.
Related: