Files

27 lines
958 B
PHP
Raw Permalink Normal View History

2026-04-16 17:46:50 +02:00
<?php
2026-05-16 11:21:43 +02:00
declare(strict_types=1);
2026-04-16 17:46:50 +02:00
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);
}
}