WordPress.org

Make WordPress Core

Changeset 51792


Ignore:
Timestamp:
09/09/2021 10:43:49 PM (3 months ago)
Author:
hellofromTonya
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions/anonymization.php

    r51415 r51792  
    2727     * @ticket 43545
    2828     *
     29     * @covers ::wp_privacy_anonymize_ip
     30     *
    2931     * @param string $raw_ip          Raw IP address.
    3032     * @param string $expected_result Expected result.
     
    5860            ),
    5961            array(
     62                false,
     63                '0.0.0.0',
     64            ),
     65            array(
     66                true,
     67                '0.0.0.0',
     68            ),
     69            array(
     70                0,
     71                '0.0.0.0',
     72            ),
     73            array(
     74                1,
     75                '0.0.0.0',
     76            ),
     77            array(
    6078                '',
    6179                '0.0.0.0',
     
    166184     * @requires function inet_ntop
    167185     * @requires function inet_pton
     186     *
     187     * @covers ::wp_privacy_anonymize_ip
    168188     *
    169189     * @param string $raw_ip          Raw IP address.
Note: See TracChangeset for help on using the changeset viewer.