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