Standardized ordering field handling and added validation for short URLs list

This commit is contained in:
Alejandro Celaya
2022-01-09 11:23:27 +01:00
parent d0c9f5a776
commit 2abcaf02e2
12 changed files with 68 additions and 92 deletions

View File

@@ -263,10 +263,10 @@ class ListShortUrlsCommandTest extends TestCase
public function provideOrderBy(): iterable
{
yield [[], null];
yield [['--order-by' => 'foo'], 'foo'];
yield [['--order-by' => 'foo,ASC'], 'foo-ASC'];
yield [['--order-by' => 'bar,DESC'], 'bar-DESC'];
yield [['--order-by' => 'baz-DESC'], 'baz-DESC'];
yield [['--order-by' => 'visits'], 'visits'];
yield [['--order-by' => 'longUrl,ASC'], 'longUrl-ASC'];
yield [['--order-by' => 'shortCode,DESC'], 'shortCode-DESC'];
yield [['--order-by' => 'title-DESC'], 'title-DESC'];
}
/** @test */