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:
35
tests/Feature/ScoringAndSecurityTest.php
Normal file
35
tests/Feature/ScoringAndSecurityTest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Apoloz\AlfaBank\Core\AlfaBankConnector;
|
||||
use Apoloz\AlfaBank\Requests\Scoring\GetComplianceScoreRequest;
|
||||
use Apoloz\AlfaBank\Requests\Security\GetSubscriptionsRequest;
|
||||
use Saloon\Http\Faking\MockResponse;
|
||||
|
||||
test('can get compliance score', function () {
|
||||
$mockClient = new \Saloon\Http\Faking\MockClient([
|
||||
GetComplianceScoreRequest::class => MockResponse::make(['score' => 'LOW_RISK'], 200),
|
||||
]);
|
||||
|
||||
$config = createTestConfig();
|
||||
$connector = new AlfaBankConnector($config);
|
||||
$connector->withMockClient($mockClient);
|
||||
|
||||
$response = $connector->send(new GetComplianceScoreRequest('7700000000'));
|
||||
|
||||
expect($response->status())->toBe(200)
|
||||
->and($response->json('score'))->toBe('LOW_RISK');
|
||||
});
|
||||
|
||||
test('can get security subscriptions', function () {
|
||||
$mockClient = new \Saloon\Http\Faking\MockClient([
|
||||
GetSubscriptionsRequest::class => MockResponse::make(['subscriptions' => []], 200),
|
||||
]);
|
||||
|
||||
$config = createTestConfig();
|
||||
$connector = new AlfaBankConnector($config);
|
||||
$connector->withMockClient($mockClient);
|
||||
|
||||
$response = $connector->send(new GetSubscriptionsRequest());
|
||||
|
||||
expect($response->status())->toBe(200);
|
||||
});
|
||||
Reference in New Issue
Block a user