MockResponse::make(['dn' => 'CN=Test'], 200), ]); $config = createTestConfig(); $connector = new AlfaBankConnector($config); $connector->withMockClient($mockClient); $response = $connector->send(new GetDnRequest()); expect($response->status())->toBe(200); }); test('can request rsa certificate issue', function () { $mockClient = new \Saloon\Http\Faking\MockClient([ IssueRsaCertificateRequest::class => MockResponse::make(['id' => 'ISSUE-1'], 200), ]); $config = createTestConfig(); $connector = new AlfaBankConnector($config); $connector->withMockClient($mockClient); $response = $connector->send(new IssueRsaCertificateRequest(tokenSerialNumber: '123')); expect($response->status())->toBe(200); }); test('can submit signing request', function () { $mockClient = new \Saloon\Http\Faking\MockClient([ SubmitSigningRequest::class => MockResponse::make(['operationId' => 'OP-1'], 200), ]); $config = createTestConfig(); $connector = new AlfaBankConnector($config); $connector->withMockClient($mockClient); $response = $connector->send(new SubmitSigningRequest('REQ-1')); expect($response->status())->toBe(200); }); test('can confirm signing with sms', function () { $mockClient = new \Saloon\Http\Faking\MockClient([ ConfirmSigningWithSmsRequest::class => MockResponse::make([], 200), ]); $config = createTestConfig(); $connector = new AlfaBankConnector($config); $connector->withMockClient($mockClient); $response = $connector->send(new ConfirmSigningWithSmsRequest('OP-1', '123456')); expect($response->status())->toBe(200); });