mirror of
git://develop.git.wordpress.org/
synced 2025-03-24 22:10:02 +01:00
Tests: Add more invalid IP test cases and @covers
to Tests_Functions_Anonymization
.
Adds a few more invalid IP test cases. Adds extra `@covers` tag for the two functions which are testing the `wp_privacy_anonymize_ip()` function. (At class level, the `wp_privacy_anonymize_data()` is set as covered). Follow-up to [42971]. Props jrf, hellofromTonya. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51792 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1d0e4441c1
commit
c556e0dbab
@ -26,6 +26,8 @@ class Tests_Functions_Anonymization extends WP_UnitTestCase {
|
||||
* @ticket 41083
|
||||
* @ticket 43545
|
||||
*
|
||||
* @covers ::wp_privacy_anonymize_ip
|
||||
*
|
||||
* @param string $raw_ip Raw IP address.
|
||||
* @param string $expected_result Expected result.
|
||||
*/
|
||||
@ -56,6 +58,22 @@ class Tests_Functions_Anonymization extends WP_UnitTestCase {
|
||||
null,
|
||||
'0.0.0.0',
|
||||
),
|
||||
array(
|
||||
false,
|
||||
'0.0.0.0',
|
||||
),
|
||||
array(
|
||||
true,
|
||||
'0.0.0.0',
|
||||
),
|
||||
array(
|
||||
0,
|
||||
'0.0.0.0',
|
||||
),
|
||||
array(
|
||||
1,
|
||||
'0.0.0.0',
|
||||
),
|
||||
array(
|
||||
'',
|
||||
'0.0.0.0',
|
||||
@ -166,6 +184,8 @@ class Tests_Functions_Anonymization extends WP_UnitTestCase {
|
||||
* @requires function inet_ntop
|
||||
* @requires function inet_pton
|
||||
*
|
||||
* @covers ::wp_privacy_anonymize_ip
|
||||
*
|
||||
* @param string $raw_ip Raw IP address.
|
||||
* @param string $expected_result Expected result.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user