GetMessageCodeTextTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testGetMessageCodeText() 0 12 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 GetMessageCodeTextTest 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 testGetMessageCodeText(): void
31
    {
32
        $actualResult = $this->model->getMessageCodeText();
33
        $this->assertNotEmpty($actualResult);
34
        $entity = array_shift($actualResult);
35
        $expectedKeys = [
36
            'MessageCode',
37
            'MessageDescriptionRU',
38
            'MessageDescriptionUA',
39
            'MessageText'
40
        ];
41
        $this->assertEntity($entity, $expectedKeys);
42
    }
43
}
44