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