mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-09-12 11:06:31 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c9be65c290 | |||
| d164dab97f | |||
| e67aa7abef | |||
| d3a88ef157 |
@@ -18,10 +18,11 @@ 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: tests.yml
|
workflow: unit-tests
|
||||||
name: clover.xml
|
name: clover.xml
|
||||||
path: build/coverage
|
path: build/coverage
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ 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("Unable to get DNS record for the host: $errorMessage");
|
throw new \RuntimeException(sprintf('Unable to get DNS record for the host: %s', $errorMessage));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -28,18 +28,4 @@ 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