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:
Tonya Mork 2021-09-09 22:43:49 +00:00
parent 1d0e4441c1
commit c556e0dbab

View File

@ -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.
*/