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\Integration\Models\Address;
use PHPUnit\Framework\TestCase;
use SergeyNezbritskiy\NovaPoshta\Models\Address;
use SergeyNezbritskiy\NovaPoshta\NovaPoshtaApiException;
use SergeyNezbritskiy\NovaPoshta\Tests\UsesConnectionTrait;
class GetSettlementsTest extends TestCase
{
use UsesConnectionTrait;
private Address $model;
protected function setUp(): void
$connection = $this->getConnection();
$this->model = new Address($connection);
}
/**
* @return void
* @throws NovaPoshtaApiException
*/
public function testGetSettlements(): void
$actualResult = $this->model->getSettlements(['FindByString' => 'Київ'], true, 1, 10);
$this->assertNotEmpty($actualResult);
$this->assertIsSettlement(array_shift($actualResult));
* @param array $settlement
private function assertIsSettlement(array $settlement): void
$this->assertArrayHasKey('Ref', $settlement);
$this->assertArrayHasKey('SettlementType', $settlement);