for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace SergeyNezbritskiy\NovaPoshta\Tests\Unit\Models\Address;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\TestCase;
use RuntimeException;
use SergeyNezbritskiy\NovaPoshta\Connection;
use SergeyNezbritskiy\NovaPoshta\Models\Address;
use SergeyNezbritskiy\NovaPoshta\NovaPoshtaApiException;
class AddressCrudTest extends TestCase
{
private Address $model;
/**
* @return void
* @throws Exception
*/
protected function setUp(): void
$connection = $this->createMock(Connection::class);
$this->model = new Address($connection);
}
* @throws NovaPoshtaApiException
public function testCreateAddressTooLongNote(): void
$note = 'This is the note that exceeds forty symbols - the limit from Nova Poshta API';
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Note exceeds the limit of 40 symbols');
$this->model->save('', [], $note);
public function testUpdateAddressTooLongNote(): void
$this->model->update([], $note);