8
8
use Yoti \DocScan \Session \Retrieve \CheckResponse ;
9
9
use Yoti \DocScan \Session \Retrieve \GetSessionResult ;
10
10
use Yoti \DocScan \Session \Retrieve \IdentityProfileResponse ;
11
+ use Yoti \DocScan \Session \Retrieve \ThirdPartyIdentityFraudOneCheckResponse ;
11
12
use Yoti \Test \TestCase ;
12
13
use Yoti \Util \DateTime ;
13
14
@@ -21,6 +22,7 @@ class GetSessionResultTest extends TestCase
21
22
private const ID_DOCUMENT_TEXT_DATA_CHECK = 'ID_DOCUMENT_TEXT_DATA_CHECK ' ;
22
23
private const ID_DOCUMENT_COMPARISON = 'ID_DOCUMENT_COMPARISON ' ;
23
24
private const THIRD_PARTY_IDENTITY = 'THIRD_PARTY_IDENTITY ' ;
25
+ private const THIRD_PARTY_IDENTITY_FRAUD_1 = "THIRD_PARTY_IDENTITY_FRAUD_1 " ;
24
26
private const WATCHLIST_SCREENING = 'WATCHLIST_SCREENING ' ;
25
27
private const WATCHLIST_ADVANCED_CA = 'WATCHLIST_ADVANCED_CA ' ;
26
28
private const SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK = 'SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK ' ;
@@ -122,6 +124,7 @@ public function shouldParseUnknownCheck()
122
124
* @covers ::getSupplementaryDocumentTextDataChecks
123
125
* @covers ::getLivenessChecks
124
126
* @covers ::getWatchlistAdvancedCaChecks
127
+ * @covers ::getThirdPartyIdentityFraudOneChecks
125
128
* @covers ::createCheckFromArray
126
129
* @covers ::filterCheckByType
127
130
*/
@@ -138,12 +141,13 @@ public function shouldFilterChecks(): void
138
141
['type ' => self ::SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK ],
139
142
['type ' => self ::LIVENESS ],
140
143
['type ' => self ::WATCHLIST_ADVANCED_CA ],
144
+ ['type ' => self ::THIRD_PARTY_IDENTITY_FRAUD_1 ],
141
145
],
142
146
];
143
147
144
148
$ result = new GetSessionResult ($ input );
145
149
146
- $ this ->assertCount (9 , $ result ->getChecks ());
150
+ $ this ->assertCount (10 , $ result ->getChecks ());
147
151
$ this ->assertCount (1 , $ result ->getAuthenticityChecks ());
148
152
$ this ->assertCount (1 , $ result ->getFaceMatchChecks ());
149
153
$ this ->assertCount (1 , $ result ->getTextDataChecks ());
@@ -154,6 +158,7 @@ public function shouldFilterChecks(): void
154
158
$ this ->assertCount (1 , $ result ->getSupplementaryDocumentTextDataChecks ());
155
159
$ this ->assertCount (1 , $ result ->getLivenessChecks ());
156
160
$ this ->assertCount (1 , $ result ->getWatchlistAdvancedCaChecks ());
161
+ $ this ->assertCount (1 , $ result ->getThirdPartyIdentityFraudOneChecks ());
157
162
158
163
$ this ->assertEquals (
159
164
self ::ID_DOCUMENT_AUTHENTICITY ,
@@ -195,5 +200,29 @@ public function shouldFilterChecks(): void
195
200
self ::LIVENESS ,
196
201
$ result ->getLivenessChecks ()[0 ]->getType ()
197
202
);
203
+
204
+ $ this ->assertInstanceOf (
205
+ ThirdPartyIdentityFraudOneCheckResponse::class,
206
+ $ result ->getThirdPartyIdentityFraudOneChecks ()[0 ]
207
+ );
208
+ }
209
+
210
+ /**
211
+ * @test
212
+ * @covers ::getThirdPartyIdentityFraudOneChecks
213
+ * @covers ::createCheckFromArray
214
+ * @covers ::filterCheckByType
215
+ */
216
+ public function thirdPartyIdentityFraudOneChecksShouldReturnEmptyCollectionWhenNoneOfTypeArePresent ()
217
+ {
218
+ $ input = [
219
+ 'checks ' => [
220
+ ['type ' => self ::ID_DOCUMENT_AUTHENTICITY ],
221
+ ],
222
+ ];
223
+
224
+ $ result = new GetSessionResult ($ input );
225
+
226
+ $ this ->assertCount (0 , $ result ->getThirdPartyIdentityFraudOneChecks ());
198
227
}
199
228
}
0 commit comments