Passed
Push — master ( 2113f4...0612f0 )
by Sergey
03:32 queued 01:00
created

DeleteContactPersonTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testDeleteNotExistingContactPerson() 0 4 1
A setUp() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SergeyNezbritskiy\NovaPoshta\Tests\Integration\Models\ContactPerson;
6
7
use Exception;
8
use PHPUnit\Framework\TestCase;
9
use SergeyNezbritskiy\NovaPoshta\Models\ContactPerson;
10
use SergeyNezbritskiy\NovaPoshta\Models\Counterparty;
11
use SergeyNezbritskiy\NovaPoshta\NovaPoshtaApiException;
12
use SergeyNezbritskiy\NovaPoshta\Tests\UsesConnectionTrait;
13
14
use function count;
15
16
class DeleteContactPersonTest extends TestCase
17
{
18
    use UsesConnectionTrait;
19
20
    /**
21
     * Counterparty Ref
22
     */
23
    private const COUNTERPARTY_REF = '98d078a0-e096-11e6-8ba8-005056881c6b';
24
25
    private ContactPerson $model;
26
    private Counterparty $counterpartyModel;
27
28
    protected function setUp(): void
29
    {
30
        $connection = $this->getConnection();
31
        $this->model = new ContactPerson($connection);
32
        $this->counterpartyModel = new Counterparty($connection);
33
    }
34
35
    /**
36
     * @return void
37
     * @throws NovaPoshtaApiException
38
     * @throws Exception
39
     */
40
    public function testDeleteNotExistingContactPerson(): void
41
    {
42
        $this->model->delete('not-existing-contact-person-ref');
43
        $this->assertTrue(true, 'No exception has been thrown, we are good');
44
    }
45
}
46