Enforce a schema to be provided when short URLs are created

This commit is contained in:
Alejandro Celaya
2023-03-25 09:52:47 +01:00
parent 11f94b8306
commit b6e1c65c4c
26 changed files with 135 additions and 107 deletions

View File

@@ -268,6 +268,8 @@ class CreateShortUrlTest extends ApiTestCase
yield 'missing long url v3' => [[], '3', 'https://shlink.io/api/error/invalid-data'];
yield 'empty long url v2' => [['longUrl' => null], '2', 'INVALID_ARGUMENT'];
yield 'empty long url v3' => [['longUrl' => ' '], '3', 'https://shlink.io/api/error/invalid-data'];
yield 'missing url schema v2' => [['longUrl' => 'foo.com'], '2', 'INVALID_ARGUMENT'];
yield 'missing url schema v3' => [['longUrl' => 'foo.com'], '3', 'https://shlink.io/api/error/invalid-data'];
yield 'empty device long url v2' => [[
'longUrl' => 'foo',
'deviceLongUrls' => [