mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-09-03 22:19:28 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d42c8731f0 | |||
| 515346048d | |||
| 4fc3f5c419 | |||
| 7dc3b8de4c |
@@ -18,11 +18,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Setup logs directory
|
- name: Setup logs directory
|
||||||
run: mkdir -p build/coverage
|
run: mkdir -p build/coverage
|
||||||
|
|
||||||
- name: Download clover.xml artifact
|
- name: Download clover.xml artifact
|
||||||
uses: dawidd6/action-download-artifact@v7
|
uses: dawidd6/action-download-artifact@v7
|
||||||
with:
|
with:
|
||||||
workflow: unit-tests
|
workflow: tests.yml
|
||||||
name: clover.xml
|
name: clover.xml
|
||||||
path: build/coverage
|
path: build/coverage
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class LocalPart extends PartParser
|
|||||||
|
|
||||||
public function parse(): Result
|
public function parse(): Result
|
||||||
{
|
{
|
||||||
|
$this->lexer->clearRecorded();
|
||||||
$this->lexer->startRecording();
|
$this->lexer->startRecording();
|
||||||
|
|
||||||
while (!$this->lexer->current->isA(EmailLexer::S_AT) && !$this->lexer->current->isA(EmailLexer::S_EMPTY)) {
|
while (!$this->lexer->current->isA(EmailLexer::S_AT) && !$this->lexer->current->isA(EmailLexer::S_EMPTY)) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class DNSGetRecordWrapper
|
|||||||
// A workaround to fix https://bugs.php.net/bug.php?id=73149
|
// A workaround to fix https://bugs.php.net/bug.php?id=73149
|
||||||
set_error_handler(
|
set_error_handler(
|
||||||
static function (int $errorLevel, string $errorMessage): never {
|
static function (int $errorLevel, string $errorMessage): never {
|
||||||
throw new \RuntimeException(sprintf('Unable to get DNS record for the host: %s', $errorMessage));
|
throw new \RuntimeException("Unable to get DNS record for the host: $errorMessage");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -28,4 +28,18 @@ class EmailParserTest extends TestCase
|
|||||||
$this->assertEquals($local, $parser->getLocalPart());
|
$this->assertEquals($local, $parser->getLocalPart());
|
||||||
$this->assertEquals($domain, $parser->getDomainPart());
|
$this->assertEquals($domain, $parser->getDomainPart());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testMultipleEmailAddresses()
|
||||||
|
{
|
||||||
|
$parser = new EmailParser(new EmailLexer());
|
||||||
|
$parser->parse('some-local-part@some-random-but-large-domain-part.example.com');
|
||||||
|
|
||||||
|
$this->assertSame('some-local-part', $parser->getLocalPart());
|
||||||
|
$this->assertSame('some-random-but-large-domain-part.example.com', $parser->getDomainPart());
|
||||||
|
|
||||||
|
$parser->parse('another-local-part@another.example.com');
|
||||||
|
|
||||||
|
$this->assertSame('another-local-part', $parser->getLocalPart());
|
||||||
|
$this->assertSame('another.example.com', $parser->getDomainPart());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user