mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-05 23:03:11 +08:00
New CLI command to create the initial API key idempotently
This commit is contained in:
@@ -22,10 +22,10 @@ class ApiKeyRepositoryTest extends DatabaseTestCase
|
||||
public function initialApiKeyIsCreatedOnlyOfNoApiKeysExistYet(): void
|
||||
{
|
||||
self::assertCount(0, $this->repo->findAll());
|
||||
$this->repo->createInitialApiKey('initial_value');
|
||||
self::assertNotNull($this->repo->createInitialApiKey('initial_value'));
|
||||
self::assertCount(1, $this->repo->findAll());
|
||||
self::assertCount(1, $this->repo->findBy(['key' => 'initial_value']));
|
||||
$this->repo->createInitialApiKey('another_one');
|
||||
self::assertNull($this->repo->createInitialApiKey('another_one'));
|
||||
self::assertCount(1, $this->repo->findAll());
|
||||
self::assertCount(0, $this->repo->findBy(['key' => 'another_one']));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user