mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Added API test for /domains endpoint
This commit is contained in:
parent
614e1c37f8
commit
06eda073bf
1 changed files with 37 additions and 0 deletions
37
module/Rest/test-api/Action/ListDomainsTest.php
Normal file
37
module/Rest/test-api/Action/ListDomainsTest.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue