GetDocumentDeliveryDateTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SergeyNezbritskiy\NovaPoshta\Tests\Integration\Models\InternetDocument;
6
7
use DateTime;
8
use PHPUnit\Framework\TestCase;
9
use SergeyNezbritskiy\NovaPoshta\Models\InternetDocument;
10
use SergeyNezbritskiy\NovaPoshta\NovaPoshtaApiException;
11
use SergeyNezbritskiy\NovaPoshta\Tests\AssertEntityByPropertiesTrait;
12
use SergeyNezbritskiy\NovaPoshta\Tests\ConstantsInterface;
13
use SergeyNezbritskiy\NovaPoshta\Tests\UsesConnectionTrait;
14
15
class GetDocumentDeliveryDateTest extends TestCase implements ConstantsInterface
16
{
17
    use AssertEntityByPropertiesTrait;
18
    use UsesConnectionTrait;
19
20
    private InternetDocument $model;
21
22
    protected function setUp(): void
23
    {
24
        $connection = $this->getConnection();
25
        $this->model = new InternetDocument($connection);
26
    }
27
28
    /**
29
     * @throws NovaPoshtaApiException
30
     */
31
    public function testGetDeliveryDateTest(): void
32
    {
33
        $actualResult = $this->model->getDocumentDeliveryDate([
34
            'DateTime' => (new DateTime())->format('d.m.Y'),
35
            'ServiceType' => 'WarehouseWarehouse',
36
            'CitySender' => self::CITY_REF_KHARKIV,
37
            'CityRecipient' => self::CITY_REF_KYIV,
38
        ]);
39
        $this->assertEntity($actualResult, ['date', 'timezone', 'timezone_type']);
40
    }
41
}
42