mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-09 06:55:40 -06:00
25 lines
786 B
PHP
25 lines
786 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace ShlinkioTest\Shlink\Core\Exception;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Shlinkio\Shlink\Core\Exception\InvalidDomainException;
|
|
|
|
class InvalidDomainExceptionTest extends TestCase
|
|
{
|
|
/** @test */
|
|
public function configuresTheExceptionAsExpected(): void
|
|
{
|
|
$e = InvalidDomainException::forDefaultDomainRedirects();
|
|
$expected = 'You cannot configure default domain\'s redirects this way. Use the configuration or env vars.';
|
|
|
|
self::assertEquals($expected, $e->getMessage());
|
|
self::assertEquals($expected, $e->getDetail());
|
|
self::assertEquals('Invalid domain', $e->getTitle());
|
|
self::assertEquals('INVALID_DOMAIN', $e->getType());
|
|
self::assertEquals(403, $e->getStatus());
|
|
}
|
|
}
|