mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Convert DeleteShortUrlVisitsCommand into invokable command
This commit is contained in:
@@ -36,7 +36,7 @@ class DeleteShortUrlVisitsCommandTest extends TestCase
|
||||
$this->deleter->expects($this->never())->method('deleteShortUrlVisits');
|
||||
$this->commandTester->setInputs($input);
|
||||
|
||||
$exitCode = $this->commandTester->execute(['shortCode' => 'foo']);
|
||||
$exitCode = $this->commandTester->execute(['short-code' => 'foo']);
|
||||
$output = $this->commandTester->getDisplay();
|
||||
|
||||
self::assertEquals(Command::SUCCESS, $exitCode);
|
||||
@@ -67,8 +67,8 @@ class DeleteShortUrlVisitsCommandTest extends TestCase
|
||||
|
||||
public static function provideErrorArgs(): iterable
|
||||
{
|
||||
yield 'domain' => [['shortCode' => 'foo'], 'Short URL not found for "foo"'];
|
||||
yield 'no domain' => [['shortCode' => 'foo', '--domain' => 's.test'], 'Short URL not found for "s.test/foo"'];
|
||||
yield 'domain' => [['short-code' => 'foo'], 'Short URL not found for "foo"'];
|
||||
yield 'no domain' => [['short-code' => 'foo', '--domain' => 's.test'], 'Short URL not found for "s.test/foo"'];
|
||||
}
|
||||
|
||||
#[Test]
|
||||
@@ -77,7 +77,7 @@ class DeleteShortUrlVisitsCommandTest extends TestCase
|
||||
$this->deleter->expects($this->once())->method('deleteShortUrlVisits')->willReturn(new BulkDeleteResult(5));
|
||||
$this->commandTester->setInputs(['yes']);
|
||||
|
||||
$exitCode = $this->commandTester->execute(['shortCode' => 'foo']);
|
||||
$exitCode = $this->commandTester->execute(['short-code' => 'foo']);
|
||||
$output = $this->commandTester->getDisplay();
|
||||
|
||||
self::assertEquals(Command::SUCCESS, $exitCode);
|
||||
|
||||
Reference in New Issue
Block a user