shlink/module/Rest/test-api/Action/ListDomainsTest.php
2020-09-27 10:23:17 +02:00

37 lines
1 KiB
PHP

<?php
declare(strict_types=1);
namespace ShlinkioApiTest\Shlink\Rest\Action;
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
class ListDomainsTest extends ApiTestCase
{
/** @test */
public function domainsAreProperlyListed(): void
{
$resp = $this->callApiWithKey(self::METHOD_GET, '/domains');
$respPayload = $this->getJsonResponsePayload($resp);
self::assertEquals(self::STATUS_OK, $resp->getStatusCode());
self::assertEquals([
'domains' => [
'data' => [
[
'domain' => 'doma.in',
'isDefault' => true,
],
[
'domain' => 'example.com',
'isDefault' => false,
],
[
'domain' => 'some-domain.com',
'isDefault' => false,
],
],
],
], $respPayload);
}
}