2025-10-14 17:40:48 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Tests\Controller;
|
|
|
|
|
|
2025-10-14 18:48:40 +02:00
|
|
|
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
|
2025-10-14 17:40:48 +02:00
|
|
|
use App\Entity\Domain;
|
|
|
|
|
use App\Factory\UserFactory;
|
2025-10-14 18:48:40 +02:00
|
|
|
use App\Tests\AuthenticatedUserTrait;
|
2025-10-14 17:40:48 +02:00
|
|
|
use App\Tests\Service\RDAPServiceTest;
|
|
|
|
|
use PHPUnit\Framework\Attributes\DependsExternal;
|
|
|
|
|
use Zenstruck\Foundry\Test\Factories;
|
|
|
|
|
|
2025-10-14 18:48:40 +02:00
|
|
|
final class DomainRefreshControllerTest extends ApiTestCase
|
2025-10-14 17:40:48 +02:00
|
|
|
{
|
|
|
|
|
use Factories;
|
2025-10-14 18:48:40 +02:00
|
|
|
use AuthenticatedUserTrait;
|
2025-10-14 17:40:48 +02:00
|
|
|
|
|
|
|
|
#[DependsExternal(RDAPServiceTest::class, 'testUpdateRdapServers')]
|
|
|
|
|
public function testRegisterDomain(): void
|
|
|
|
|
{
|
|
|
|
|
$testUser = UserFactory::createOne();
|
|
|
|
|
$client = DomainRefreshControllerTest::createClientWithCredentials(DomainRefreshControllerTest::getToken($testUser));
|
|
|
|
|
$client->request('GET', '/api/domains/example.com');
|
|
|
|
|
|
|
|
|
|
$this->assertResponseIsSuccessful();
|
|
|
|
|
$this->assertMatchesResourceItemJsonSchema(Domain::class);
|
|
|
|
|
}
|
|
|
|
|
}
|