2018-11-17 19:23:25 +01:00
|
|
|
<?php
|
2019-10-05 17:26:10 +02:00
|
|
|
|
2018-11-17 19:23:25 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace ShlinkioTest\Shlink\Core\Exception;
|
|
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-11-24 23:11:25 +01:00
|
|
|
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
2018-11-17 19:23:25 +01:00
|
|
|
|
|
|
|
|
class InvalidShortCodeExceptionTest extends TestCase
|
|
|
|
|
{
|
2019-02-17 20:28:34 +01:00
|
|
|
/** @test */
|
|
|
|
|
public function properlyCreatesExceptionFromNotFoundShortCode(): void
|
2018-11-17 19:23:25 +01:00
|
|
|
{
|
2019-11-24 23:11:25 +01:00
|
|
|
$e = ShortUrlNotFoundException::fromNotFoundShortCode('abc123');
|
2018-11-17 19:23:25 +01:00
|
|
|
|
2019-11-23 13:41:07 +01:00
|
|
|
$this->assertEquals('No URL found for short code "abc123"', $e->getMessage());
|
2018-11-17 19:23:25 +01:00
|
|
|
}
|
|
|
|
|
}
|