get(EntityManagerInterface::class); static::$RDAPService = static::$container->get(RDAPService::class); } public function testUpdateRdapServers(): void { $updateRdapServersHandler = self::$container->get(UpdateRdapServersHandler::class); $message = new UpdateRdapServers(); $updateRdapServersHandler($message); self::$entityManager->flush(); $rdapServerRepository = self::$entityManager->getRepository(RdapServer::class); $this->assertNotEmpty($rdapServerRepository->findAll()); } #[Depends('testUpdateRdapServers')] public function testRegisterDomain(): void { $rdapServerRepository = self::$entityManager->getRepository(RdapServer::class); $testedTldList = ['com', 'net', 'org', 'fr', 'de', 'ch', 'ca', 'leclerc', 'uz']; /** @var RdapServer $rdapServer */ foreach ($rdapServerRepository->findAll() as $rdapServer) { if (!in_array($rdapServer->getTld()->getTld(), $testedTldList)) { continue; } try { self::$RDAPService->registerDomain('nic.'.$rdapServer->getTld()->getTld()); } catch (DomainNotFoundException|ClientException|TransportException) { } } $this->expectNotToPerformAssertions(); } #[Depends('testUpdateRdapServers')] public function testUnknownRdapServer(): void { $this->expectException(UnknownRdapServerException::class); self::$RDAPService->registerDomain('nic.arpa'); } #[Depends('testUpdateRdapServers')] public function testUnknownTld(): void { $this->expectException(TldNotSupportedException::class); self::$RDAPService->registerDomain('nic.noexist'); } }