feat: check malformed domain names

This commit is contained in:
Maël Gangloff
2025-10-16 14:16:58 +02:00
parent a20344816c
commit a143039925
8 changed files with 77 additions and 32 deletions

View File

@@ -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();