Skip to content

Commit b2cdc5c

Browse files
committed
Upd. Unit tests for apbct_is_skip_request().
1 parent 99626d3 commit b2cdc5c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tests/Inc/TestContactIsSkipRequest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,6 @@ function () {},
158158
$expected_reason
159159
)
160160
);
161-
//wrong reason
162-
self::assertFalse(
163-
self::skipped(
164-
$expected_key,
165-
$expected_action,
166-
$plugin_slug,
167-
function () {},
168-
'not_valid_reason'
169-
)
170-
);
171161
//success
172162
return true;
173163
}
@@ -195,6 +185,12 @@ private static function skipped(string $expected_key, string $expected_action, s
195185

196186
$result = apbct_is_skip_request(true);
197187

188+
if (is_string($result)) {
189+
self::assertEquals($expected_reason, $result);
190+
} else {
191+
self::assertFalse($result);
192+
}
193+
198194
update_option( 'active_plugins', array(), false );
199195

200196
return $result === $expected_reason;

0 commit comments

Comments
 (0)