Passed
Pull Request — master (#12)
by Sergey
02:32
created

GetTimeIntervalsTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
dl 0
loc 4
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\ConstantsInterface;
12
use SergeyNezbritskiy\NovaPoshta\Tests\UsesConnectionTrait;
13
14
class GetTimeIntervalsTest extends TestCase implements ConstantsInterface
15
{
16
    use AssertEntityByPropertiesTrait;
17
    use UsesConnectionTrait;
18
19
    private Common $model;
20
21
    protected function setUp(): void
22
    {
23
        $connection = $this->getConnection();
24
        $this->model = new Common($connection);
25
    }
26
27
    /**
28
     * @return void
29
     * @throws NovaPoshtaApiException
30
     */
31
    public function testGetTimeIntervals(): void
32
    {
33
        $actualResult = $this->model->getTimeIntervals(self::CITY_REF);
34
        $this->assertNotEmpty($actualResult);
35
        $entity = array_shift($actualResult);
36
        $expectedKeys = [
37
            'Number',
38
            'Start',
39
            'End',
40
        ];
41
        $this->assertEntity($entity, $expectedKeys);
42
    }
43
}
44