diff --git a/module/CLI/test-cli/Command/CreateShortUrlTest.php b/module/CLI/test-cli/Command/CreateShortUrlTest.php new file mode 100644 index 00000000..d4d8a583 --- /dev/null +++ b/module/CLI/test-cli/Command/CreateShortUrlTest.php @@ -0,0 +1,31 @@ +exec( + [CreateShortUrlCommand::NAME, 'https://example.com', '--domain', $defaultDomain, '--custom-slug', $slug], + ); + + self::assertEquals(ExitCodes::EXIT_SUCCESS, $exitCode); + self::assertStringContainsString('Generated short URL: http://' . $defaultDomain . '/' . $slug, $output); + + [$listOutput] = $this->exec([ListShortUrlsCommand::NAME, '--show-domain', '--search-term', $slug]); + self::assertStringContainsString('DEFAULT', $listOutput); + } +}