mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: check malformed domain names
This commit is contained in:
@@ -7,6 +7,7 @@ namespace App\Tests\Entity;
|
||||
use App\Entity\Domain;
|
||||
use App\Entity\DomainEvent;
|
||||
use App\Entity\DomainStatus;
|
||||
use App\Exception\MalformedDomainException;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
@@ -159,7 +160,7 @@ final class DomainTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testSetLdhName(): void
|
||||
public function testIdnDomainName(): void
|
||||
{
|
||||
/*
|
||||
* @see https://en.wikipedia.org/wiki/IDN_Test_TLDs
|
||||
@@ -180,6 +181,12 @@ final class DomainTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testInvalidDomainName()
|
||||
{
|
||||
$this->expectException(MalformedDomainException::class);
|
||||
(new Domain())->setLdhName('*');
|
||||
}
|
||||
|
||||
public static function isToBeUpdatedProvider(): array
|
||||
{
|
||||
$now = new \DateTimeImmutable();
|
||||
|
||||
Reference in New Issue
Block a user