mirror of
https://github.com/shlinkio/shlink.git
synced 2026-05-31 08:27:22 -05:00
28 lines
958 B
PHP
28 lines
958 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace ShlinkioCliTest\Shlink\CLI\Command;
|
|
|
|
use PHPUnit\Framework\Attributes\Test;
|
|
use Shlinkio\Shlink\CLI\Command\ShortUrl\EditShortUrlCommand;
|
|
use Shlinkio\Shlink\CLI\Command\ShortUrl\ResolveUrlCommand;
|
|
use Shlinkio\Shlink\TestUtils\CliTest\CliTestCase;
|
|
use Symfony\Component\Console\Command\Command;
|
|
|
|
class EditShortUrlTest extends CliTestCase
|
|
{
|
|
#[Test]
|
|
public function longUrlCanBeEdited(): void
|
|
{
|
|
[$originalOutput] = $this->exec([ResolveUrlCommand::NAME, 'abc123']);
|
|
self::assertStringContainsString('Long URL: https://shlink.io', $originalOutput);
|
|
|
|
[, $exitCode] = $this->exec([EditShortUrlCommand::NAME, 'abc123', '--long-url', 'https://example.com']);
|
|
self::assertEquals(Command::SUCCESS, $exitCode);
|
|
|
|
[$newOutput] = $this->exec([ResolveUrlCommand::NAME, 'abc123']);
|
|
self::assertStringContainsString('Long URL: https://example.com', $newOutput);
|
|
}
|
|
}
|