Skip to content

Commit 837e891

Browse files
author
Rodion Liuborets
committed
Release-3.9.1 Tests Covering
1 parent 5fe44d7 commit 837e891

6 files changed

+101
-0
lines changed

tests/DocScan/Session/Create/Check/Advanced/RequestedExactMatchingStrategyTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,32 @@ class RequestedExactMatchingStrategyTest extends TestCase
1515
* @test
1616
* @covers ::build
1717
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedExactMatchingStrategy::isExactMatch
18+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedExactMatchingStrategy::getType
19+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\Advanced\RequestedCaMatchingStrategy::getType
1820
*/
1921
public function builderShouldBuildRequestedExactMatchingStrategyTest(): void
2022
{
2123
$result = (new RequestedExactMatchingStrategyBuilder())->build();
2224

2325
Assert::assertNotNull($result);
2426
Assert::assertEquals(true, $result->isExactMatch());
27+
Assert::assertEquals('EXACT', $result->getType());
28+
}
29+
30+
/**
31+
* @test
32+
* @covers ::build
33+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedExactMatchingStrategy::jsonSerialize
34+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\Advanced\RequestedCaMatchingStrategy::jsonSerialize
35+
*/
36+
public function builderShouldBuildCorrectJson(): void
37+
{
38+
$result = (new RequestedExactMatchingStrategyBuilder())->build();
39+
40+
$expected = [
41+
'type' => 'EXACT'
42+
];
43+
44+
Assert::assertEquals(json_encode($expected), json_encode($result));
2545
}
2646
}

tests/DocScan/Session/Create/Check/Advanced/RequestedFuzzyMatchingStrategyTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class RequestedFuzzyMatchingStrategyTest extends TestCase
2121
* @covers ::build
2222
* @covers ::withFuzziness
2323
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedFuzzyMatchingStrategy::getFuzziness
24+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedFuzzyMatchingStrategy::getType
25+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\Advanced\RequestedCaMatchingStrategy::getType
2426
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedFuzzyMatchingStrategy::__construct
2527
*/
2628
public function builderShouldBuildWithCorrectFuzziness(): void
@@ -31,5 +33,28 @@ public function builderShouldBuildWithCorrectFuzziness(): void
3133

3234
Assert::assertNotNull($result);
3335
Assert::assertEquals(self::SOME_FUZZINESS, $result->getFuzziness());
36+
Assert::assertEquals('FUZZY', $result->getType());
37+
}
38+
39+
/**
40+
* @test
41+
* @covers ::build
42+
* @covers ::withFuzziness
43+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedFuzzyMatchingStrategy::__construct
44+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedFuzzyMatchingStrategy::jsonSerialize
45+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\Advanced\RequestedCaMatchingStrategy::jsonSerialize
46+
*/
47+
public function builderShouldBuildCorrectJson(): void
48+
{
49+
$result = (new RequestedFuzzyMatchingStrategyBuilder())
50+
->withFuzziness(self::SOME_FUZZINESS)
51+
->build();
52+
53+
$expected = [
54+
'type' => 'FUZZY',
55+
'fuzziness' => self::SOME_FUZZINESS
56+
];
57+
58+
Assert::assertEquals(json_encode($expected), json_encode($result));
3459
}
3560
}

tests/DocScan/Session/Create/Check/Advanced/RequestedSearchProfileSourcesTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class RequestedSearchProfileSourcesTest extends TestCase
2121
* @covers ::build
2222
* @covers ::withSearchProfile
2323
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedSearchProfileSources::getSearchProfile
24+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedSearchProfileSources::getType
25+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\Advanced\RequestedCaSources::getType
2426
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedSearchProfileSources::__construct
2527
*/
2628
public function builderShouldBuildWithCorrectSearchProfile(): void
@@ -31,5 +33,29 @@ public function builderShouldBuildWithCorrectSearchProfile(): void
3133

3234
Assert::assertNotNull($result);
3335
Assert::assertEquals(self::SOME_SEARCH_PROFILE, $result->getSearchProfile());
36+
Assert::assertEquals('PROFILE', $result->getType());
37+
}
38+
39+
/**
40+
* @test
41+
* @covers ::build
42+
* @covers ::withSearchProfile
43+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedSearchProfileSources::getSearchProfile
44+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedSearchProfileSources::jsonSerialize
45+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedSearchProfileSources::__construct
46+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\Advanced\RequestedCaSources::jsonSerialize
47+
*/
48+
public function builderShouldBuildWithCorrectJson(): void
49+
{
50+
$result = (new RequestedSearchProfileSourcesBuilder())
51+
->withSearchProfile(self::SOME_SEARCH_PROFILE)
52+
->build();
53+
54+
$expected = [
55+
'type' => 'PROFILE',
56+
'search_profile' => self::SOME_SEARCH_PROFILE
57+
];
58+
59+
Assert::assertEquals(json_encode($expected), json_encode($result));
3460
}
3561
}

tests/DocScan/Session/Create/Check/Advanced/RequestedTypeListSourcesTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class RequestedTypeListSourcesTest extends TestCase
2121
* @covers ::build
2222
* @covers ::withTypes
2323
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedTypeListSources::getTypes
24+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedTypeListSources::getType
25+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\Advanced\RequestedCaSources::getType
2426
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedTypeListSources::__construct
2527
*/
2628
public function builderShouldBuildWithCorrectListOfTypes(): void
@@ -31,5 +33,28 @@ public function builderShouldBuildWithCorrectListOfTypes(): void
3133

3234
Assert::assertNotNull($result);
3335
Assert::assertEquals(self::SOME_TYPES, $result->getTypes());
36+
Assert::assertEquals('TYPE_LIST', $result->getType());
37+
}
38+
39+
/**
40+
* @test
41+
* @covers ::build
42+
* @covers ::withTypes
43+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedTypeListSources::getTypes
44+
* @covers \Yoti\DocScan\Session\Create\Check\Advanced\RequestedTypeListSources::jsonSerialize
45+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\Advanced\RequestedCaSources::jsonSerialize
46+
*/
47+
public function builderShouldBuildWithCorrectJson(): void
48+
{
49+
$result = (new RequestedTypeListSourcesBuilder())
50+
->withTypes(self::SOME_TYPES)
51+
->build();
52+
53+
$expected = [
54+
'type' => 'TYPE_LIST',
55+
'types' => self::SOME_TYPES
56+
];
57+
58+
Assert::assertEquals(json_encode($expected), json_encode($result));
3459
}
3560
}

tests/DocScan/Session/Create/Check/RequestedCustomAccountWatchlistAdvancedCaConfigTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ public function setup(): void
5252
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\RequestedWatchlistAdvancedCaConfig::getRemoveDeceased
5353
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\RequestedWatchlistAdvancedCaConfig::__construct
5454
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\RequestedWatchlistAdvancedCaConfig::jsonSerialize
55+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\RequestedWatchlistAdvancedCaConfig::getType
5556
* @covers \Yoti\DocScan\Session\Create\Check\RequestedCustomAccountWatchlistAdvancedCaConfig::getTags
5657
* @covers \Yoti\DocScan\Session\Create\Check\RequestedCustomAccountWatchlistAdvancedCaConfig::getMonitoring
5758
* @covers \Yoti\DocScan\Session\Create\Check\RequestedCustomAccountWatchlistAdvancedCaConfig::getClientRef
5859
* @covers \Yoti\DocScan\Session\Create\Check\RequestedCustomAccountWatchlistAdvancedCaConfig::getApiKey
5960
* @covers \Yoti\DocScan\Session\Create\Check\RequestedCustomAccountWatchlistAdvancedCaConfig::__construct
61+
* @covers \Yoti\DocScan\Session\Create\Check\RequestedCustomAccountWatchlistAdvancedCaConfig::getType
6062
*/
6163
public function builderShouldBuildWithCorrectProperties()
6264
{
@@ -80,6 +82,7 @@ public function builderShouldBuildWithCorrectProperties()
8082
Assert::assertEquals(self::SOME_CLIENT_REF, $result->getClientRef());
8183
Assert::assertEquals(self::SOME_MONITORING, $result->getMonitoring());
8284
Assert::assertEquals((object)self::SOME_TAGS, $result->getTags());
85+
Assert::assertEquals('WITH_CUSTOM_ACCOUNT', $result->getType());
8386

8487
$expected = [
8588
'remove_deceased' => true,

tests/DocScan/Session/Create/Check/RequestedYotiAccountWatchlistAdvancedCaConfigTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class RequestedYotiAccountWatchlistAdvancedCaConfigTest extends TestCase
2424
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\RequestedWatchlistAdvancedCaConfigBuilder::withShareUrl
2525
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\RequestedWatchlistAdvancedCaConfigBuilder::withRemoveDeceased
2626
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\RequestedWatchlistAdvancedCaConfigBuilder::build
27+
* @covers \Yoti\DocScan\Session\Create\Check\Contracts\RequestedWatchlistAdvancedCaConfig::getType
2728
*/
2829
public function builderShouldBuildWithCorrectProperties(): void
2930
{
@@ -42,5 +43,6 @@ public function builderShouldBuildWithCorrectProperties(): void
4243
Assert::assertEquals(self::SOME_SHARE_URL, $result->getShareUrl());
4344
Assert::assertEquals($profileSource, $result->getSources());
4445
Assert::assertEquals($exactMatchingStrategy, $result->getMatchingStrategy());
46+
Assert::assertEquals('WITH_YOTI_ACCOUNT', $result->getType());
4547
}
4648
}

0 commit comments

Comments
 (0)