Files
alfa-bank-sdk/tests/Feature/CustomerInfo/CustomerInfoTest.php
Anatoliy Poloz b15d29f8e9 fix(formating)
2026-01-28 03:36:26 +03:00

29 lines
952 B
PHP

<?php
use Apoloz\AlfaBank\Core\AlfaBankConnector;
use Apoloz\AlfaBank\Requests\CustomerInfo\GetCustomerInfoRequest;
use Saloon\Http\Faking\MockResponse;
test('can get customer info', function (): void {
$mockClient = new \Saloon\Http\Faking\MockClient([
GetCustomerInfoRequest::class => MockResponse::make([
'organizationId' => 'org-123',
'fullName' => 'OOO Romashka',
'shortName' => 'Romashka',
'inn' => '1234567890',
'kpps' => ['123456789'],
'ogrn' => '1234567890123',
], 200),
]);
$config = createTestConfig();
$connector = new AlfaBankConnector($config);
$connector->withMockClient($mockClient);
$response = $connector->send(new GetCustomerInfoRequest);
expect($response->status())->toBe(200)
->and($response->dto()->organizationId)->toBe('org-123')
->and($response->dto()->fullName)->toBe('OOO Romashka');
});