chore: merge test/add-phpunit

This commit is contained in:
Maël Gangloff
2025-09-11 10:58:23 +02:00
12 changed files with 554 additions and 317 deletions

View File

@@ -41,7 +41,7 @@ class RegisterDomainCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$ldhName = strtolower(idn_to_ascii($input->getArgument('domain')));
$ldhName = RDAPService::convertToIdn($input->getArgument('domain'));
$force = (bool) $input->getOption('force');
$notif = (bool) $input->getOption('notif');
$domain = $this->domainRepository->findOneBy(['ldhName' => $ldhName]);

View File

@@ -41,7 +41,7 @@ class DomainRefreshController extends AbstractController
*/
public function __invoke(string $ldhName, Request $request): Domain
{
$idnDomain = strtolower(idn_to_ascii($ldhName));
$idnDomain = RDAPService::convertToIdn($ldhName);
$userId = $this->getUser()->getUserIdentifier();
$this->logger->info('User {username} wants to update the domain name {idnDomain}.', [

View File

@@ -378,7 +378,7 @@ class Domain
*
* @throws \Exception
*/
private function isToBeWatchClosely(): bool
protected function isToBeWatchClosely(): bool
{
$status = $this->getStatus();
if ((!empty($status) && count(array_intersect($status, self::IMPORTANT_STATUS))) || $this->getDeleted()) {

View File

@@ -45,7 +45,7 @@ use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
readonly class RDAPService
class RDAPService
{
/* @see https://www.iana.org/domains/root/db */
public const ISO_TLD_EXCEPTION = ['ac', 'eu', 'uk', 'su', 'tp'];
@@ -199,7 +199,7 @@ readonly class RDAPService
throw new BadRequestException('Domain must contain at least one dot');
}
$tld = strtolower(idn_to_ascii(substr($domain, $lastDotPosition + 1)));
$tld = self::convertToIdn(substr($domain, $lastDotPosition + 1));
$tldEntity = $this->tldRepository->findOneBy(['tld' => $tld]);
if (null === $tldEntity) {