mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: use state provider
This commit is contained in:
28
tests/State/AutoRegisterDomainProviderTest.php
Normal file
28
tests/State/AutoRegisterDomainProviderTest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\State;
|
||||
|
||||
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
|
||||
use App\Entity\Domain;
|
||||
use App\Factory\UserFactory;
|
||||
use App\Tests\AuthenticatedUserTrait;
|
||||
use App\Tests\Service\RDAPServiceTest;
|
||||
use PHPUnit\Framework\Attributes\DependsExternal;
|
||||
use Zenstruck\Foundry\Test\Factories;
|
||||
|
||||
final class AutoRegisterDomainProviderTest extends ApiTestCase
|
||||
{
|
||||
use Factories;
|
||||
use AuthenticatedUserTrait;
|
||||
|
||||
#[DependsExternal(RDAPServiceTest::class, 'testUpdateRdapServers')]
|
||||
public function testRegisterDomain(): void
|
||||
{
|
||||
$testUser = UserFactory::createOne();
|
||||
$client = AutoRegisterDomainProviderTest::createClientWithCredentials(AutoRegisterDomainProviderTest::getToken($testUser));
|
||||
$client->request('GET', '/api/domains/example.com');
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
$this->assertMatchesResourceItemJsonSchema(Domain::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user