mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
test: add Domain unit tests
This commit is contained in:
@@ -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]);
|
||||
|
||||
@@ -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}.', [
|
||||
|
||||
@@ -366,7 +366,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()) {
|
||||
|
||||
@@ -203,7 +203,7 @@ 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) {
|
||||
|
||||
Reference in New Issue
Block a user