Create ShortUrlVisitsDeleterTest

This commit is contained in:
Alejandro Celaya
2023-05-14 12:32:54 +02:00
parent ffc0555c7c
commit 69ff7de481
3 changed files with 59 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Core\ShortUrl;
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
use Shlinkio\Shlink\Core\Model\BulkDeleteResult;
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
use Shlinkio\Shlink\Core\Visit\Repository\VisitDeleterRepositoryInterface;
@@ -17,6 +18,9 @@ class ShortUrlVisitsDeleter implements ShortUrlVisitsDeleterInterface
) {
}
/**
* @throws ShortUrlNotFoundException
*/
public function deleteShortUrlVisits(ShortUrlIdentifier $identifier, ?ApiKey $apiKey): BulkDeleteResult
{
$this->resolver->resolveShortUrl($identifier, $apiKey);

View File

@@ -4,11 +4,15 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Core\ShortUrl;
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
use Shlinkio\Shlink\Core\Model\BulkDeleteResult;
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
use Shlinkio\Shlink\Rest\Entity\ApiKey;
interface ShortUrlVisitsDeleterInterface
{
/**
* @throws ShortUrlNotFoundException
*/
public function deleteShortUrlVisits(ShortUrlIdentifier $identifier, ?ApiKey $apiKey): BulkDeleteResult;
}