Convert ResolveUrlCommand into invokable command

This commit is contained in:
Alejandro Celaya
2025-12-15 10:16:09 +01:00
parent c30ec261c9
commit 9e4ea80139
2 changed files with 21 additions and 39 deletions

View File

@@ -40,7 +40,7 @@ class ResolveUrlCommandTest extends TestCase
ShortUrlIdentifier::fromShortCodeAndDomain($shortCode),
)->willReturn($shortUrl);
$this->commandTester->execute(['shortCode' => $shortCode]);
$this->commandTester->execute(['short-code' => $shortCode]);
$output = $this->commandTester->getDisplay();
self::assertEquals('Long URL: ' . $expectedUrl . PHP_EOL, $output);
}
@@ -68,7 +68,7 @@ class ResolveUrlCommandTest extends TestCase
ShortUrlNotFoundException::fromNotFound($identifier),
);
$this->commandTester->execute(['shortCode' => $shortCode]);
$this->commandTester->execute(['short-code' => $shortCode]);
$output = $this->commandTester->getDisplay();
self::assertStringContainsString(sprintf('No URL found with short code "%s"', $shortCode), $output);
}