-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathAnaf.php
More file actions
85 lines (60 loc) · 2.64 KB
/
Copy pathAnaf.php
File metadata and controls
85 lines (60 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
use Anaf\Client;
it('may create a client on stage and a client on prod', function () {
$anafClientStage = Anaf::client(isStage: true);
$anafClientProd = Anaf::client();
expect($anafClientStage)->toBeInstanceOf(Client::class)
->and($anafClientProd)->toBeInstanceOf(Client::class);
checkStageValue($anafClientStage, true);
checkStageValue($anafClientProd, false);
});
it('may create an authorized client on stage and an authorized client on prod', function () {
$anafClientStage = Anaf::authorizedClient('dummy-api-key', isStage: true);
$anafClientProd = Anaf::authorizedClient('dummy-api-key');
expect($anafClientStage)->toBeInstanceOf(Client::class)
->and($anafClientProd)->toBeInstanceOf(Client::class);
checkStageValue($anafClientStage, true);
checkStageValue($anafClientProd, false);
});
it('may create an authorized on stage and a client on prod', function () {
$anafClientStage = Anaf::authorizedClient('dummy-api-key', isStage: true);
$anafClientProd = Anaf::client();
expect($anafClientStage)->toBeInstanceOf(Client::class)
->and($anafClientProd)->toBeInstanceOf(Client::class);
checkStageValue($anafClientStage, true);
checkStageValue($anafClientProd, false);
});
it('may create a client on stage and an authorized on prod', function () {
$anafClientStage = Anaf::client(isStage: true);
$anafClientProd = Anaf::authorizedClient('dummy-api-key');
expect($anafClientStage)->toBeInstanceOf(Client::class)
->and($anafClientProd)->toBeInstanceOf(Client::class);
checkStageValue($anafClientStage, true);
checkStageValue($anafClientProd, false);
});
it('may create a client on stage', function () {
$anafClient = Anaf::client(isStage: true);
expect($anafClient)->toBeInstanceOf(Client::class);
checkStageValue($anafClient, true);
});
it('may create an authorized client on stage', function () {
$anafClient = Anaf::authorizedClient('dummy-api-key', isStage: true);
expect($anafClient)->toBeInstanceOf(Client::class);
checkStageValue($anafClient, true);
});
it('may create a client', function () {
$anafClient = Anaf::client();
expect($anafClient)->toBeInstanceOf(Client::class);
checkStageValue($anafClient, false);
});
it('may create an authorized client', function () {
$anafClient = Anaf::authorizedClient('dummy-api-key');
expect($anafClient)->toBeInstanceOf(Client::class);
checkStageValue($anafClient, false);
});
it('may create a client via factory', function () {
$anafClient = Anaf::factory()
->withApiKey('foo')
->make();
expect($anafClient)->toBeInstanceOf(Client::class);
});