GetCargoDescriptionListTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 14
dl 0
loc 28
rs 10
c 1
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testGetCargoDescriptionList() 0 11 1
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 GetCargoDescriptionListTest 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 testGetCargoDescriptionList(): void
31
    {
32
        $actualResult = $this->model->getCargoDescriptionList();
33
        $this->assertNotEmpty($actualResult);
34
        $entity = array_shift($actualResult);
35
        $expectedKeys = [
36
            'Ref',
37
            'Description',
38
            'DescriptionRu',
39
        ];
40
        $this->assertEntity($entity, $expectedKeys);
41
    }
42
}
43