| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 14 | class AddressCrudTest extends TestCase |
||
| 15 | { |
||
| 16 | private Address $model; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @return void |
||
| 20 | * @throws Exception |
||
| 21 | */ |
||
| 22 | protected function setUp(): void |
||
| 23 | { |
||
| 24 | $connection = $this->createMock(Connection::class); |
||
| 25 | $this->model = new Address($connection); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @throws NovaPoshtaApiException |
||
| 30 | */ |
||
| 31 | public function testCreateAddressTooLongNote(): void |
||
| 32 | { |
||
| 33 | $note = 'This is the note that exceeds forty symbols - the limit from Nova Poshta API'; |
||
| 34 | $this->expectException(RuntimeException::class); |
||
| 35 | $this->expectExceptionMessage('Note exceeds the limit of 40 symbols'); |
||
| 36 | $this->model->save('', [], $note); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @throws NovaPoshtaApiException |
||
| 41 | */ |
||
| 42 | public function testUpdateAddressTooLongNote(): void |
||
| 48 | } |
||
| 49 | } |
||
| 50 |