mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Return deviceLongUrls as part of the short URL data and document API changes
This commit is contained in:
@@ -20,6 +20,9 @@ use Shlinkio\Shlink\Core\ShortUrl\ShortUrlService;
|
||||
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||
use ShlinkioTest\Shlink\Core\Util\ApiKeyHelpersTrait;
|
||||
|
||||
use function array_fill_keys;
|
||||
use function Shlinkio\Shlink\Core\enumValues;
|
||||
|
||||
class ShortUrlServiceTest extends TestCase
|
||||
{
|
||||
use ApiKeyHelpersTrait;
|
||||
@@ -74,7 +77,7 @@ class ShortUrlServiceTest extends TestCase
|
||||
);
|
||||
|
||||
$resolveDeviceLongUrls = function () use ($shortUrlEdit): array {
|
||||
$result = [];
|
||||
$result = array_fill_keys(enumValues(DeviceType::class), null);
|
||||
foreach ($shortUrlEdit->deviceLongUrls ?? [] as $longUrl) {
|
||||
$result[$longUrl->deviceType->value] = $longUrl->longUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user