request('GET', '/api/domains/example.com'); $this->assertResponseIsSuccessful(); $this->assertMatchesResourceItemJsonSchema(Domain::class); } #[DependsExternal(RDAPServiceTest::class, 'testUpdateRdapServers')] public function testRegisterDomainAnonymousUnauthorized(): void { $client = $this->createClient(); $client->request('GET', '/api/domains/example.com'); $this->assertResponseStatusCodeSame(401); } #[DependsExternal(RDAPServiceTest::class, 'testUpdateRdapServers')] public function testRegisterDomainAlreadyUpdated(): void { $client = AutoRegisterDomainProviderTest::createClientWithCredentials(AutoRegisterDomainProviderTest::getToken(UserFactory::createOne())); $mockedDomain = $this->getMockBuilder(Domain::class)->getMock(); $mockedDomainRepository = $this->createMock(DomainRepository::class); $mockedDomainRepository->method('findOneBy')->willReturn($mockedDomain); $rdapServiceMocked = $this->createMock(RDAPService::class); $rdapServiceMocked->method('isToBeUpdated')->willReturn(false); $rdapServiceMocked->expects(self::never())->method('registerDomain'); $container = static::getContainer(); $container->set(DomainRepository::class, $mockedDomainRepository); $container->set(RDAPService::class, $rdapServiceMocked); $client->request('GET', '/api/domains/example.com'); } }