@@ -52,23 +52,23 @@ public function testSuspiciousStrings(string $string, array $options)
52
52
public static function provideSuspiciousStrings (): iterable
53
53
{
54
54
yield 'Fails restriction level check because of character outside ASCII range ' => ['à ' ,
55
- ['restrictionLevel ' => \Spoofchecker:: ASCII ],
55
+ ['restrictionLevel ' => NoSuspiciousCharacters:: RESTRICTION_LEVEL_ASCII ],
56
56
];
57
57
yield 'Fails restriction level check because of mixed-script string ' => ['àㄚ ' , [
58
- 'restrictionLevel ' => \Spoofchecker:: SINGLE_SCRIPT_RESTRICTIVE ,
58
+ 'restrictionLevel ' => NoSuspiciousCharacters:: RESTRICTION_LEVEL_SINGLE_SCRIPT ,
59
59
'profileLocales ' => ['zh_Hant_TW ' ],
60
60
]];
61
61
yield 'Fails restriction level check because of disallowed Armenian script ' => ['àԱ ' , [
62
- 'restrictionLevel ' => \Spoofchecker:: HIGHLY_RESTRICTIVE ,
62
+ 'restrictionLevel ' => NoSuspiciousCharacters:: RESTRICTION_LEVEL_HIGH ,
63
63
'profileLocales ' => ['hy_AM ' ],
64
64
]];
65
65
yield 'Fails restriction level check because of disallowed Greek script ' => ['àπ ' , [
66
- 'restrictionLevel ' => \Spoofchecker:: MODERATELY_RESTRICTIVE ,
66
+ 'restrictionLevel ' => NoSuspiciousCharacters:: RESTRICTION_LEVEL_MODERATE ,
67
67
'profileLocales ' => ['el_GR ' ],
68
68
]];
69
69
yield 'Fails restriction level check because of Greek script absent from profile ' => ['àπ ' , [
70
70
'checks ' => NoSuspiciousCharacters::CHECK_RESTRICTION_LEVEL ,
71
- 'restrictionLevel ' => \Spoofchecker:: MINIMALLY_RESTRICTIVE ,
71
+ 'restrictionLevel ' => NoSuspiciousCharacters:: RESTRICTION_LEVEL_MINIMAL ,
72
72
]];
73
73
74
74
yield 'Fails INVISIBLE check because of duplicated non-spacing mark ' => ['à̀ ' , [
@@ -84,4 +84,17 @@ public static function provideSuspiciousStrings(): iterable
84
84
'checks ' => NoSuspiciousCharacters::CHECK_HIDDEN_OVERLAY ,
85
85
]];
86
86
}
87
+
88
+ public function testConstants (): void
89
+ {
90
+ $ this ->assertSame (\Spoofchecker::INVISIBLE , NoSuspiciousCharacters::CHECK_INVISIBLE );
91
+ $ this ->assertSame (\Spoofchecker::CHAR_LIMIT , NoSuspiciousCharacters::CHECK_CHAR_LIMIT );
92
+
93
+ $ this ->assertSame (\Spoofchecker::ASCII , NoSuspiciousCharacters::RESTRICTION_LEVEL_ASCII );
94
+ $ this ->assertSame (\Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE , NoSuspiciousCharacters::RESTRICTION_LEVEL_SINGLE_SCRIPT );
95
+ $ this ->assertSame (\Spoofchecker::HIGHLY_RESTRICTIVE , NoSuspiciousCharacters::RESTRICTION_LEVEL_HIGH );
96
+ $ this ->assertSame (\Spoofchecker::MODERATELY_RESTRICTIVE , NoSuspiciousCharacters::RESTRICTION_LEVEL_MODERATE );
97
+ $ this ->assertSame (\Spoofchecker::MINIMALLY_RESTRICTIVE , NoSuspiciousCharacters::RESTRICTION_LEVEL_MINIMAL );
98
+ $ this ->assertSame (\Spoofchecker::UNRESTRICTIVE , NoSuspiciousCharacters::RESTRICTION_LEVEL_NONE );
99
+ }
87
100
}
0 commit comments