testGetOwnershipFormList()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
dl 0
loc 11
rs 10
c 1
b 0
f 1
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SergeyNezbritskiy\NovaPoshta\Tests\Integration\Models\Common;
6
7
use PHPUnit\Framework\TestCase;
8
use SergeyNezbritskiy\NovaPoshta\Models\Common;
9
use SergeyNezbritskiy\NovaPoshta\NovaPoshtaApiException;
10
use SergeyNezbritskiy\NovaPoshta\Tests\AssertEntityByPropertiesTrait;
11
use SergeyNezbritskiy\NovaPoshta\Tests\UsesConnectionTrait;
12
13
class GetOwnershipFormListTest extends TestCase
14
{
15
    use AssertEntityByPropertiesTrait;
16
    use UsesConnectionTrait;
17
18
    private Common $model;
19
20
    protected function setUp(): void
21
    {
22
        $connection = $this->getConnection();
23
        $this->model = new Common($connection);
24
    }
25
26
    /**
27
     * @return void
28
     * @throws NovaPoshtaApiException
29
     */
30
    public function testGetOwnershipFormList(): void
31
    {
32
        $actualResult = $this->model->getOwnershipFormsList();
33
        $this->assertNotEmpty($actualResult);
34
        $entity = array_shift($actualResult);
35
        $expectedKeys = [
36
            'Description',
37
            'FullName',
38
            'Ref',
39
        ];
40
        $this->assertEntity($entity, $expectedKeys);
41
    }
42
}
43