Completed
Push — develop ( 8109ce...b15e90 )
by Alejandro
17s queued 12s
created

ListDomainsTest::domainsAreProperlyListed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 24
rs 9.8333
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ShlinkioApiTest\Shlink\Rest\Action;
6
7
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
8
9
class ListDomainsTest extends ApiTestCase
10
{
11
    /** @test */
12
    public function domainsAreProperlyListed(): void
13
    {
14
        $resp = $this->callApiWithKey(self::METHOD_GET, '/domains');
15
        $respPayload = $this->getJsonResponsePayload($resp);
16
17
        self::assertEquals(self::STATUS_OK, $resp->getStatusCode());
18
        self::assertEquals([
19
            'domains' => [
20
                'data' => [
21
                    [
22
                        'domain' => 'doma.in',
23
                        'isDefault' => true,
24
                    ],
25
                    [
26
                        'domain' => 'example.com',
27
                        'isDefault' => false,
28
                    ],
29
                    [
30
                        'domain' => 'some-domain.com',
31
                        'isDefault' => false,
32
                    ],
33
                ],
34
            ],
35
        ], $respPayload);
36
    }
37
}
38