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:
34
tests/Feature/AffIntegrationTest.php
Normal file
34
tests/Feature/AffIntegrationTest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Apoloz\AlfaBank\Core\AlfaBankConnector;
|
||||
use Apoloz\AlfaBank\Requests\Aff\CheckComplianceRequest;
|
||||
use Apoloz\AlfaBank\Requests\Aff\CreateRegisterRequest;
|
||||
use Saloon\Http\Faking\MockResponse;
|
||||
|
||||
test('can check aff compliance', function () {
|
||||
$mockClient = new \Saloon\Http\Faking\MockClient([
|
||||
CheckComplianceRequest::class => MockResponse::make(['status' => 'APPROVED'], 200),
|
||||
]);
|
||||
|
||||
$config = createTestConfig();
|
||||
$connector = new AlfaBankConnector($config);
|
||||
$connector->withMockClient($mockClient);
|
||||
|
||||
$response = $connector->send(new CheckComplianceRequest('7700000000', 'Test LLC'));
|
||||
|
||||
expect($response->status())->toBe(200);
|
||||
});
|
||||
|
||||
test('can create aff register', function () {
|
||||
$mockClient = new \Saloon\Http\Faking\MockClient([
|
||||
CreateRegisterRequest::class => MockResponse::make(['id' => 'AFF-123'], 200),
|
||||
]);
|
||||
|
||||
$config = createTestConfig();
|
||||
$connector = new AlfaBankConnector($config);
|
||||
$connector->withMockClient($mockClient);
|
||||
|
||||
$response = $connector->send(new CreateRegisterRequest(new \Apoloz\AlfaBank\Data\Aff\AffRegisterData([])));
|
||||
|
||||
expect($response->status())->toBe(200);
|
||||
});
|
||||
Reference in New Issue
Block a user