@@ -153,15 +153,14 @@ public function test_init_on_cron(): void {
153153 *
154154 * @param boolean $logged_in User is logged in.
155155 * @param string $hcaptcha_off_when_logged_in Option 'hcaptcha_off_when_logged_in' is set.
156- * @param boolean|string $whitelisted Whether IP is whitelisted .
156+ * @param boolean|string $allowlisted Whether IP is allowlisted .
157157 * @param boolean $hcaptcha_active Plugin should be active.
158158 *
159159 * @dataProvider dp_test_init
160160 * @throws ReflectionException ReflectionException.
161161 * @noinspection PhpUnitTestsInspection
162- * @noinspection UnusedFunctionResultInspection
163162 */
164- public function test_init_and_init_hooks ( bool $ logged_in , string $ hcaptcha_off_when_logged_in , $ whitelisted , bool $ hcaptcha_active ): void {
163+ public function test_init_and_init_hooks ( bool $ logged_in , string $ hcaptcha_off_when_logged_in , $ allowlisted , bool $ hcaptcha_active ): void {
165164 global $ current_user ;
166165
167166 $ hcaptcha = hcaptcha ();
@@ -180,8 +179,8 @@ public function test_init_and_init_hooks( bool $logged_in, string $hcaptcha_off_
180179
181180 add_filter (
182181 'hcap_whitelist_ip ' ,
183- static function () use ( $ whitelisted ) {
184- return $ whitelisted ;
182+ static function () use ( $ allowlisted ) {
183+ return $ allowlisted ;
185184 }
186185 );
187186
@@ -223,7 +222,7 @@ static function () use ( $whitelisted ) {
223222 -PHP_INT_MAX ,
224223 has_filter (
225224 'hcap_whitelist_ip ' ,
226- [ $ subject , 'whitelist_ip ' ]
225+ [ $ subject , 'allowlist_ip ' ]
227226 )
228227 );
229228
@@ -253,14 +252,14 @@ static function () use ( $whitelisted ) {
253252 */
254253 public function dp_test_init (): array {
255254 return [
256- 'not logged in, not set, not whitelisted ' => [ false , 'off ' , false , true ],
257- 'not logged in, set, not whitelisted ' => [ false , 'on ' , false , true ],
258- 'logged in, not set, not whitelisted ' => [ true , 'off ' , false , true ],
259- 'logged in, set, not whitelisted ' => [ true , 'on ' , false , false ],
260- 'not logged in, not set, whitelisted ' => [ false , 'off ' , true , false ],
261- 'not logged in, set, whitelisted ' => [ false , 'on ' , true , false ],
262- 'logged in, not set, whitelisted ' => [ true , 'off ' , true , false ],
263- 'logged in, set, whitelisted ' => [ true , 'on ' , true , false ],
255+ 'not logged in, not set, not allowlisted ' => [ false , 'off ' , false , true ],
256+ 'not logged in, set, not allowlisted ' => [ false , 'on ' , false , true ],
257+ 'logged in, not set, not allowlisted ' => [ true , 'off ' , false , true ],
258+ 'logged in, set, not allowlisted ' => [ true , 'on ' , false , false ],
259+ 'not logged in, not set, allowlisted ' => [ false , 'off ' , true , false ],
260+ 'not logged in, set, allowlisted ' => [ false , 'on ' , true , false ],
261+ 'logged in, not set, allowlisted ' => [ true , 'off ' , true , false ],
262+ 'logged in, set, allowlisted ' => [ true , 'on ' , true , false ],
264263 ];
265264 }
266265
@@ -320,7 +319,7 @@ static function () {
320319 -PHP_INT_MAX ,
321320 has_filter (
322321 'hcap_whitelist_ip ' ,
323- [ $ subject , 'whitelist_ip ' ]
322+ [ $ subject , 'allowlist_ip ' ]
324323 )
325324 );
326325
@@ -1085,31 +1084,31 @@ public function dp_test_print_footer_scripts(): array {
10851084 }
10861085
10871086 /**
1088- * Test whitelist_ip ().
1087+ * Test allowlist_ip ().
10891088 *
1090- * @param mixed $whitelisted_ips Settings.
1089+ * @param mixed $allowlisted_ips Settings.
10911090 * @param string|false $client_ip Client IP.
10921091 * @param bool $expected Expected result.
10931092 *
1094- * @dataProvider dp_test_whitelist_ip
1093+ * @dataProvider dp_test_allowlist_ip
10951094 * @return void
10961095 */
1097- public function test_whitelist_ip ( $ whitelisted_ips , $ client_ip , bool $ expected ): void {
1098- update_option ( 'hcaptcha_settings ' , [ 'whitelisted_ips ' => $ whitelisted_ips ] );
1096+ public function test_allowlist_ip ( $ allowlisted_ips , $ client_ip , bool $ expected ): void {
1097+ update_option ( 'hcaptcha_settings ' , [ 'whitelisted_ips ' => $ allowlisted_ips ] );
10991098
11001099 $ subject = new Main ();
11011100
11021101 $ subject ->init_hooks ();
11031102
1104- self ::assertSame ( $ expected , $ subject ->whitelist_ip ( false , $ client_ip ) );
1103+ self ::assertSame ( $ expected , $ subject ->allowlist_ip ( false , $ client_ip ) );
11051104 }
11061105
11071106 /**
1108- * Data provider for test_whitelist_ip ().
1107+ * Data provider for test_allowlist_ip ().
11091108 *
11101109 * @return array
11111110 */
1112- public function dp_test_whitelist_ip (): array {
1111+ public function dp_test_allowlist_ip (): array {
11131112 return [
11141113 'no settings, local ip ' => [ '' , false , false ],
11151114 'some ips, local ip ' => [ " 4444444.777.2 \r\n 220.45.45.1 \r\n" , false , false ],
0 commit comments