mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-23 21:27:44 +03:00
Create ShortUrlModeTest
This commit is contained in:
parent
d847c7648e
commit
8afa582aa5
1 changed files with 29 additions and 0 deletions
29
module/Core/test/ShortUrl/Model/ShortUrlModeTest.php
Normal file
29
module/Core/test/ShortUrl/Model/ShortUrlModeTest.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ShlinkioTest\Shlink\Core\ShortUrl\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlMode;
|
||||
|
||||
class ShortUrlModeTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider provideModes
|
||||
*/
|
||||
public function deprecatedValuesAreProperlyParsed(string $mode, ?ShortUrlMode $expected): void
|
||||
{
|
||||
self::assertSame($expected, ShortUrlMode::tryDeprecated($mode));
|
||||
}
|
||||
|
||||
public function provideModes(): iterable
|
||||
{
|
||||
yield 'invalid' => ['invalid', null];
|
||||
yield 'foo' => ['foo', null];
|
||||
yield 'loose' => ['loose', ShortUrlMode::LOOSE];
|
||||
yield 'loosely' => ['loosely', ShortUrlMode::LOOSE];
|
||||
yield 'strict' => ['strict', ShortUrlMode::STRICT];
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue