forked from apoloz/alfa-bank-sdk
29 lines
952 B
PHP
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');
|
|
});
|