2022-02-13 14:20:02 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace ShlinkioCliTest\Shlink\CLI\Command;
|
|
|
|
|
2023-02-09 22:42:18 +03:00
|
|
|
use PHPUnit\Framework\Attributes\Test;
|
2022-02-13 14:20:02 +03:00
|
|
|
use Shlinkio\Shlink\CLI\Command\Api\GenerateKeyCommand;
|
|
|
|
use Shlinkio\Shlink\CLI\Util\ExitCodes;
|
|
|
|
use Shlinkio\Shlink\TestUtils\CliTest\CliTestCase;
|
|
|
|
|
|
|
|
class GenerateApiKeyTest extends CliTestCase
|
|
|
|
{
|
2023-02-09 22:42:18 +03:00
|
|
|
#[Test]
|
2022-02-13 14:20:02 +03:00
|
|
|
public function outputIsCorrect(): void
|
|
|
|
{
|
|
|
|
[$output, $exitCode] = $this->exec([GenerateKeyCommand::NAME]);
|
|
|
|
|
|
|
|
self::assertStringContainsString('[OK] Generated API key', $output);
|
|
|
|
self::assertEquals(ExitCodes::EXIT_SUCCESS, $exitCode);
|
|
|
|
}
|
|
|
|
}
|