test: add some KernelTestCase

This commit is contained in:
Maël Gangloff
2025-10-14 17:40:48 +02:00
parent 39262814ce
commit 97ea1ab33a
10 changed files with 255 additions and 10 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Tests\Controller;
use App\Entity\Domain;
use App\Factory\UserFactory;
use App\Tests\AbstractTest;
use App\Tests\Service\RDAPServiceTest;
use PHPUnit\Framework\Attributes\DependsExternal;
use Zenstruck\Foundry\Test\Factories;
final class DomainRefreshControllerTest extends AbstractTest
{
use Factories;
#[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);
}
}