mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
test: update test suite
This commit is contained in:
@@ -33,7 +33,7 @@ final class WatchlistControllerTest extends ApiTestCase
|
||||
#[DependsExternal(RDAPServiceTest::class, 'testUpdateRdapServers')]
|
||||
public function testGetTrackedDomains()
|
||||
{
|
||||
$client = WatchListUpdateProcessorTest::createUserAndWatchlist();
|
||||
$client = WatchListUpdateProcessorTest::createUserAndWatchlist(null, ['/api/domains/example.org']);
|
||||
$response = $client->request('GET', '/api/tracked');
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
|
||||
@@ -53,11 +53,11 @@ final class WatchListUpdateProcessorTest extends ApiTestCase
|
||||
$this->assertCount(1, $data['trackedEvents']);
|
||||
}
|
||||
|
||||
public static function createUserAndWatchlist(?Client $client = null): Client
|
||||
public static function createUserAndWatchlist(?Client $client = null, array $domains = ['/api/domains/example.com']): Client
|
||||
{
|
||||
$client = $client ?? self::createClientWithCredentials(self::getToken(UserFactory::createOne()));
|
||||
$client->request('POST', '/api/watchlists', ['json' => [
|
||||
'domains' => ['/api/domains/example.com'],
|
||||
'domains' => $domains,
|
||||
'name' => 'My Watchlist',
|
||||
'trackedEvents' => ['last changed', 'transfer', 'expiration', 'deletion'],
|
||||
]]);
|
||||
|
||||
Reference in New Issue
Block a user