Refactored and fixed unit tests

This commit is contained in:
Alejandro Celaya
2019-11-26 22:12:52 +01:00
parent 5213faa0a1
commit 3b56fc3760
15 changed files with 11 additions and 171 deletions

View File

@@ -16,7 +16,7 @@ class DeleteShortUrlException extends DomainException implements ProblemDetailsE
use CommonProblemDetailsExceptionTrait;
private const TITLE = 'Cannot delete short URL';
public const TYPE = 'INVALID_SHORTCODE_DELETION'; // FIXME Should be INVALID_SHORT_URL_DELETION
private const TYPE = 'INVALID_SHORTCODE_DELETION'; // FIXME Should be INVALID_SHORT_URL_DELETION
/** @var int */
private $visitsThreshold;

View File

@@ -16,7 +16,7 @@ class InvalidUrlException extends DomainException implements ProblemDetailsExcep
use CommonProblemDetailsExceptionTrait;
private const TITLE = 'Invalid URL';
public const TYPE = 'INVALID_URL';
private const TYPE = 'INVALID_URL';
public static function fromUrl(string $url, ?Throwable $previous = null): self
{

View File

@@ -15,7 +15,7 @@ class NonUniqueSlugException extends InvalidArgumentException implements Problem
use CommonProblemDetailsExceptionTrait;
private const TITLE = 'Invalid custom slug';
public const TYPE = 'INVALID_SLUG';
private const TYPE = 'INVALID_SLUG';
public static function fromSlug(string $slug, ?string $domain): self
{

View File

@@ -15,7 +15,7 @@ class ShortUrlNotFoundException extends DomainException implements ProblemDetail
use CommonProblemDetailsExceptionTrait;
private const TITLE = 'Short URL not found';
public const TYPE = 'INVALID_SHORTCODE';
private const TYPE = 'INVALID_SHORTCODE';
public static function fromNotFoundShortCode(string $shortCode, ?string $domain = null): self
{

View File

@@ -15,7 +15,7 @@ class TagNotFoundException extends DomainException implements ProblemDetailsExce
use CommonProblemDetailsExceptionTrait;
private const TITLE = 'Tag not found';
public const TYPE = 'TAG_NOT_FOUND';
private const TYPE = 'TAG_NOT_FOUND';
public static function fromTag(string $tag): self
{

View File

@@ -22,7 +22,7 @@ class ValidationException extends InvalidArgumentException implements ProblemDet
use CommonProblemDetailsExceptionTrait;
private const TITLE = 'Invalid data';
public const TYPE = 'INVALID_ARGUMENT';
private const TYPE = 'INVALID_ARGUMENT';
/** @var array */
private $invalidElements;