forked from apoloz/alfa-bank-sdk
refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
25
tests/Feature/SelfEmployed/DictionaryTest.php
Normal file
25
tests/Feature/SelfEmployed/DictionaryTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Apoloz\AlfaBank\Core\AlfaBankConnector;
|
||||
use Apoloz\AlfaBank\Core\AlfaConfig;
|
||||
use Apoloz\AlfaBank\Requests\SelfEmployed\GetActivitiesRequest;
|
||||
use Saloon\Http\Faking\MockResponse;
|
||||
|
||||
test('can get activities dictionary', function () {
|
||||
$mockClient = new \Saloon\Http\Faking\MockClient([
|
||||
GetActivitiesRequest::class => MockResponse::make([
|
||||
['id' => '1', 'name' => 'IT Services'],
|
||||
['id' => '2', 'name' => 'Design'],
|
||||
], 200, ['Content-Type' => 'application/json']),
|
||||
]);
|
||||
|
||||
$config = createTestConfig();
|
||||
$connector = new AlfaBankConnector($config);
|
||||
$connector->withMockClient($mockClient);
|
||||
|
||||
$response = $connector->send(new GetActivitiesRequest());
|
||||
|
||||
expect($response->status())->toBe(200)
|
||||
->and($response->dto()->count())->toBe(2)
|
||||
->and($response->dto()->first()->name)->toBe('IT Services');
|
||||
});
|
||||
Reference in New Issue
Block a user