Passed
Push — master ( 77fbef...5b00d5 )
by Sergey
02:50 queued 35s
created

SearchSettlementsTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testSearchSettlements() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SergeyNezbritskiy\Tests\Integration\Models\Address;
6
7
use PHPUnit\Framework\TestCase;
8
use SergeyNezbritskiy\NovaPoshta\Models\Address;
9
use SergeyNezbritskiy\NovaPoshta\NovaPoshtaApiException;
10
use SergeyNezbritskiy\NovaPoshta\Tests\UsesConnectionTrait;
11
12
class SearchSettlementsTest extends TestCase
13
{
14
    use UsesConnectionTrait;
15
16
    private Address $model;
17
18
    protected function setUp(): void
19
    {
20
        $connection = $this->getConnection();
21
        $this->model = new Address($connection);
22
    }
23
24
    /**
25
     * @return void
26
     * @throws NovaPoshtaApiException
27
     */
28
    public function testSearchSettlements(): void
29
    {
30
        $actualResult = $this->model->searchSettlements('киев', 1, 10);
31
        $this->assertArrayHasKey('TotalCount', $actualResult);
32
        $this->assertArrayHasKey('Addresses', $actualResult);
33
    }
34
}
35