4
4
5
5
namespace Yoti \Test \DocScan \Session \Create ;
6
6
7
+ use Yoti \DocScan \Constants ;
7
8
use Yoti \DocScan \Session \Create \NotificationConfigBuilder ;
8
9
use Yoti \Test \TestCase ;
9
10
@@ -28,7 +29,7 @@ class NotificationConfigBuilderTest extends TestCase
28
29
* @covers \Yoti\DocScan\Session\Create\NotificationConfig::getEndpoint
29
30
* @covers \Yoti\DocScan\Session\Create\NotificationConfig::getTopics
30
31
*/
31
- public function shouldBuildNotificationConfig ()
32
+ public function shouldBuildNotificationConfig (): void
32
33
{
33
34
$ result = (new NotificationConfigBuilder ())
34
35
->withAuthToken (self ::SOME_AUTH_TOKEN )
@@ -47,7 +48,7 @@ public function shouldBuildNotificationConfig()
47
48
* @test
48
49
* @covers ::forResourceUpdate
49
50
*/
50
- public function shouldUseCorrectValueForResourceUpdate ()
51
+ public function shouldUseCorrectValueForResourceUpdate (): void
51
52
{
52
53
$ result = (new NotificationConfigBuilder ())
53
54
->withAuthToken (self ::SOME_AUTH_TOKEN )
@@ -62,7 +63,7 @@ public function shouldUseCorrectValueForResourceUpdate()
62
63
* @test
63
64
* @covers ::forTaskCompletion
64
65
*/
65
- public function shouldUseCorrectValueForTaskCompletion ()
66
+ public function shouldUseCorrectValueForTaskCompletion (): void
66
67
{
67
68
$ result = (new NotificationConfigBuilder ())
68
69
->withAuthToken (self ::SOME_AUTH_TOKEN )
@@ -77,7 +78,7 @@ public function shouldUseCorrectValueForTaskCompletion()
77
78
* @test
78
79
* @covers ::forCheckCompletion
79
80
*/
80
- public function shouldUseCorrectValueForCheckCompletion ()
81
+ public function shouldUseCorrectValueForCheckCompletion (): void
81
82
{
82
83
$ result = (new NotificationConfigBuilder ())
83
84
->withAuthToken (self ::SOME_AUTH_TOKEN )
@@ -92,7 +93,7 @@ public function shouldUseCorrectValueForCheckCompletion()
92
93
* @test
93
94
* @covers ::forSessionCompletion
94
95
*/
95
- public function shouldUseCorrectValueForSessionCompletion ()
96
+ public function shouldUseCorrectValueForSessionCompletion (): void
96
97
{
97
98
$ result = (new NotificationConfigBuilder ())
98
99
->withAuthToken (self ::SOME_AUTH_TOKEN )
@@ -111,7 +112,7 @@ public function shouldUseCorrectValueForSessionCompletion()
111
112
* @covers ::forSessionCompletion
112
113
* @covers ::withTopic
113
114
*/
114
- public function shouldAllowAllNotificationTypes ()
115
+ public function shouldAllowAllNotificationTypes (): void
115
116
{
116
117
$ result = (new NotificationConfigBuilder ())
117
118
->withAuthToken (self ::SOME_AUTH_TOKEN )
@@ -133,7 +134,7 @@ public function shouldAllowAllNotificationTypes()
133
134
* @test
134
135
* @covers \Yoti\DocScan\Session\Create\NotificationConfig::jsonSerialize
135
136
*/
136
- public function shouldSerializeWithCorrectProperties ()
137
+ public function shouldSerializeWithCorrectProperties (): void
137
138
{
138
139
$ result = (new NotificationConfigBuilder ())
139
140
->withAuthToken (self ::SOME_AUTH_TOKEN )
@@ -156,7 +157,7 @@ public function shouldSerializeWithCorrectProperties()
156
157
* @test
157
158
* @covers \Yoti\DocScan\Session\Create\NotificationConfig::jsonSerialize
158
159
*/
159
- public function shouldSerializeWithoutNullValues ()
160
+ public function shouldSerializeWithoutNullValues (): void
160
161
{
161
162
$ result = (new NotificationConfigBuilder ())->build ();
162
163
@@ -166,4 +167,45 @@ public function shouldSerializeWithoutNullValues()
166
167
167
168
$ this ->assertJsonStringEqualsJsonString (json_encode ($ expected ), json_encode ($ result ));
168
169
}
170
+
171
+ /**
172
+ * @test
173
+ * @covers \Yoti\DocScan\Session\Create\NotificationConfig::getAuthType
174
+ */
175
+ public function shouldNotImplicitlySetAValueForAuthType (): void
176
+ {
177
+ $ result = (new NotificationConfigBuilder ())
178
+ ->forResourceUpdate ()
179
+ ->build ();
180
+
181
+ $ this ->assertNull ($ result ->getAuthType ());
182
+ }
183
+
184
+ /**
185
+ * @test
186
+ * @covers \Yoti\DocScan\Session\Create\NotificationConfigBuilder::withAuthTypeBasic
187
+ */
188
+ public function shouldSetAuthTypeToBasic ()
189
+ {
190
+ $ result = (new NotificationConfigBuilder ())
191
+ ->forResourceUpdate ()
192
+ ->withAuthTypeBasic ()
193
+ ->build ();
194
+
195
+ $ this ->assertEquals ($ result ->getAuthType (), Constants::BASIC );
196
+ }
197
+
198
+ /**
199
+ * @test
200
+ * @covers \Yoti\DocScan\Session\Create\NotificationConfigBuilder::withAuthTypeBearer
201
+ */
202
+ public function shouldSetAuthTypeToBearer ()
203
+ {
204
+ $ result = (new NotificationConfigBuilder ())
205
+ ->forResourceUpdate ()
206
+ ->withAuthTypeBearer ()
207
+ ->build ();
208
+
209
+ $ this ->assertEquals ($ result ->getAuthType (), Constants::BEARER );
210
+ }
169
211
}
0 commit comments