1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace SergeyNezbritskiy\NovaPoshta\Tests\Unit; |
||
6 | |||
7 | use Exception; |
||
8 | use PHPUnit\Framework\TestCase; |
||
9 | use SergeyNezbritskiy\NovaPoshta\Client; |
||
10 | use SergeyNezbritskiy\NovaPoshta\Models\Address; |
||
11 | |||
12 | /** |
||
13 | * Class ClientTest |
||
14 | * Unit test for \SergeyNezbritskiy\NovaPoshta\Client |
||
15 | * @see Client |
||
16 | */ |
||
17 | class ClientTest extends TestCase |
||
18 | { |
||
19 | protected function setUp(): void |
||
20 | { |
||
21 | $this->object = new Client('some-key'); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
22 | } |
||
23 | |||
24 | public function testAddressModelProperty(): void |
||
25 | { |
||
26 | $addressModel = $this->object->address; |
||
27 | $this->assertInstanceOf(Address::class, $addressModel); |
||
28 | } |
||
29 | |||
30 | public function testNotSupportedProperty(): void |
||
31 | { |
||
32 | $property = 'someNotSupportedModel'; |
||
33 | $this->expectExceptionMessage('Model `someNotSupportedModel` not supported by Nova Poshta API Client'); |
||
34 | $this->expectException(Exception::class); |
||
35 | $this->object->$property; |
||
36 | } |
||
37 | } |
||
38 |