Improve some console commands coverage

This commit is contained in:
Alejandro Celaya
2025-11-18 08:41:42 +01:00
parent f3ff059d48
commit 933c54e884
3 changed files with 41 additions and 0 deletions

View File

@@ -50,6 +50,19 @@ class GetShortUrlVisitsCommandTest extends TestCase
$this->commandTester->execute(['shortCode' => $shortCode]);
}
#[Test]
public function shortCodeIsAskedIfNotProvided(): void
{
$shortCode = 'abc123';
$this->visitsHelper->expects($this->once())->method('visitsForShortUrl')->with(
ShortUrlIdentifier::fromShortCodeAndDomain($shortCode),
$this->anything(),
)->willReturn(new Paginator(new ArrayAdapter([])));
$this->commandTester->setInputs([$shortCode]);
$this->commandTester->execute([]);
}
#[Test]
public function providingDateFlagsTheListGetsFiltered(): void
{