Make WordPress Core

Changeset 64439


Ignore:
Timestamp:
10/17/2026 06:50:30 PM (5 days ago)
Author:
lancewillett
Message:

Tests: Make formatting test data providers static.

Declare the data providers in tests/phpunit/tests/formatting/ as public static for compatibility with newer PHPUnit versions. Preserve their datasets and assertions. Use static properties for the emoji CDN fixture values.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14381

Props rejaulalomkhan, mukesh27.
See #66211.

Location:
trunk/tests/phpunit/tests/formatting
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/antispambot.php

    r62829 r64439  
    2929         * return array[]
    3030         */
    31         public function data_returns_valid_utf8() {
     31        public static function data_returns_valid_utf8() {
    3232                return array(
    3333                        'plain'                => array( 'bob@example.com' ),
    … …  
    7777         * @return Generator
    7878         */
    79         public function data_antispambot_obfuscates() {
     79        public static function data_antispambot_obfuscates() {
    8080                $addresses = array(
    8181                        'example@example.com',
  • trunk/tests/phpunit/tests/formatting/autopNewlinePreservationHelper.php

    r64008 r64439  
    2727         * @return array[]
    2828         */
    29         public function data_should_replace_newlines_with_placeholders() {
     29        public static function data_should_replace_newlines_with_placeholders() {
    3030                return array(
    3131                        'an empty string'                => array(
    … …  
    9090         * @return array[]
    9191         */
    92         public function data_should_only_replace_line_feeds() {
     92        public static function data_should_only_replace_line_feeds() {
    9393                return array(
    9494                        'a carriage return'             => array(
    … …  
    152152         * @return array[]
    153153         */
    154         public function data_should_preserve_newlines_as_a_preg_replace_callback() {
     154        public static function data_should_preserve_newlines_as_a_preg_replace_callback() {
    155155                return array(
    156156                        'a script element'               => array(
  • trunk/tests/phpunit/tests/formatting/balanceTags.php

    r64436 r64439  
    1818        }
    1919
    20         public function data_supported_traditional_tag_names() {
     20        public static function data_supported_traditional_tag_names() {
    2121                return array(
    2222                        array( 'a' ),
    … …  
    3838        }
    3939
    40         public function data_supported_custom_element_tag_names() {
     40        public static function data_supported_custom_element_tag_names() {
    4141                return array(
    4242                        array( 'custom-element' ),
    … …  
    5858        }
    5959
    60         public function data_invalid_tag_names() {
     60        public static function data_invalid_tag_names() {
    6161                return array(
    6262                        array( '<0-day>inside', '&lt;0-day>inside' ), // Can't start with a number - handled by the "<3" fix.
    … …  
    7878         * @link https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
    7979         */
    80         public function data_unsupported_valid_tag_names() {
     80        public static function data_unsupported_valid_tag_names() {
    8181                return array(
    8282                        // We don't allow ending in a dash.
    … …  
    146146         * @link https://w3c.github.io/webcomponents/spec/custom/#valid-custom-element-name
    147147         */
    148         public function data_supported_invalid_tag_names() {
     148        public static function data_supported_invalid_tag_names() {
    149149                return array(
    150150                        // Reserved names for custom elements.
    … …  
    182182
    183183        // This is a complete(?) listing of valid single/self-closing tags.
    184         public function data_single_tags() {
     184        public static function data_single_tags() {
    185185                return array(
    186186                        array( 'area' ),
    … …  
    220220         * @return array<string, array<string, string>>
    221221         */
    222         public function data_unknown_single_tags_with_closing_tag() {
     222        public static function data_unknown_single_tags_with_closing_tag() {
    223223                return array(
    224224                        'default'              => array( '<strong/>', '<strong></strong>' ),
    … …  
    279279        }
    280280
    281         public function data_nestable_tags() {
     281        public static function data_nestable_tags() {
    282282                return array(
    283283                        array( 'article' ),
    … …  
    391391         * @return array Data.
    392392         */
    393         public function data_custom_elements() {
     393        public static function data_custom_elements() {
    394394                return array(
    395395                        // Valid custom element tags.
  • trunk/tests/phpunit/tests/formatting/convertSmilies.php

    r59516 r64439  
    4040         * }
    4141         */
    42         public function data_convert_standard_smilies() {
     42        public static function data_convert_standard_smilies() {
    4343                $includes_path = includes_url( 'images/smilies/' );
    4444
    … …  
    110110         * }
    111111         */
    112         public function data_convert_custom_smilies() {
     112        public static function data_convert_custom_smilies() {
    113113                $includes_path = includes_url( 'images/smilies/' );
    114114
    … …  
    154154         * }
    155155         */
    156         public function data_ignore_smilies_in_tags() {
     156        public static function data_ignore_smilies_in_tags() {
    157157                return array(
    158158                        array( 'pre' ),
    … …  
    190190         * }
    191191         */
    192         public function data_smilies_combinations() {
     192        public static function data_smilies_combinations() {
    193193                $includes_path = includes_url( 'images/smilies/' );
    194194
    … …  
    259259         * }
    260260         */
    261         public function data_single_smilies_in_wpsmiliestrans() {
     261        public static function data_single_smilies_in_wpsmiliestrans() {
    262262                $includes_path = includes_url( 'images/smilies/' );
    263263
    … …  
    302302         * }
    303303         */
    304         public function data_spaces_around_smilies() {
     304        public static function data_spaces_around_smilies() {
    305305                $nbsp = "\xC2\xA0";
    306306
  • trunk/tests/phpunit/tests/formatting/date.php

    r58458 r64439  
    232232         * @return array
    233233         */
    234         public function data_timezone_provider() {
     234        public static function data_timezone_provider() {
    235235                return array(
    236236                        'valid timezone string and GMT offset'      => array(
  • trunk/tests/phpunit/tests/formatting/emoji.php

    r62410 r64439  
    77class Tests_Formatting_Emoji extends WP_UnitTestCase {
    88
    9         private $png_cdn = 'https://s.w.org/images/core/emoji/17.0.2/72x72/';
    10         private $svg_cdn = 'https://s.w.org/images/core/emoji/17.0.2/svg/';
     9        private static $png_cdn = 'https://s.w.org/images/core/emoji/17.0.2/72x72/';
     10        private static $svg_cdn = 'https://s.w.org/images/core/emoji/17.0.2/svg/';
    1111
    1212        /**
    … …  
    193193                        array_keys( $settings )
    194194                );
    195                 $this->assertSame( $this->png_cdn, $settings['baseUrl'] );
     195                $this->assertSame( self::$png_cdn, $settings['baseUrl'] );
    196196                $this->assertSame( '.png', $settings['ext'] );
    197                 $this->assertSame( $this->svg_cdn, $settings['svgUrl'] );
     197                $this->assertSame( self::$svg_cdn, $settings['svgUrl'] );
    198198                $this->assertSame( '.svg', $settings['svgExt'] );
    199199                $this->assertIsArray( $settings['source'] );
    … …  
    217217                $output = get_echo( '_print_emoji_detection_script' );
    218218
    219                 $this->assertStringContainsString( wp_json_encode( $this->png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
    220                 $this->assertStringContainsString( wp_json_encode( $this->svg_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
     219                $this->assertStringContainsString( wp_json_encode( self::$png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
     220                $this->assertStringContainsString( wp_json_encode( self::$svg_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
    221221        }
    222222
    … …  
    239239                $output = get_echo( '_print_emoji_detection_script' );
    240240
    241                 $this->assertStringContainsString( wp_json_encode( $this->png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
    242                 $this->assertStringNotContainsString( wp_json_encode( $this->svg_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
     241                $this->assertStringContainsString( wp_json_encode( self::$png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
     242                $this->assertStringNotContainsString( wp_json_encode( self::$svg_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
    243243                $this->assertStringContainsString( wp_json_encode( $filtered_svn_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
    244244
    … …  
    265265
    266266                $this->assertStringContainsString( wp_json_encode( $filtered_png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
    267                 $this->assertStringNotContainsString( wp_json_encode( $this->png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
    268                 $this->assertStringContainsString( wp_json_encode( $this->svg_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
     267                $this->assertStringNotContainsString( wp_json_encode( self::$png_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
     268                $this->assertStringContainsString( wp_json_encode( self::$svg_cdn, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), $output );
    269269
    270270                remove_filter( 'emoji_url', array( $this, '_filtered_emoji_png_cdn' ) );
    … …  
    296296        }
    297297
    298         public function data_wp_encode_emoji() {
     298        public static function data_wp_encode_emoji() {
    299299                return array(
    300300                        array(
    … …  
    336336        }
    337337
    338         public function data_wp_staticize_emoji() {
     338        public static function data_wp_staticize_emoji() {
    339339                $data = array(
    340340                        array(
    … …  
    346346                                // Simple emoji.
    347347                                '🙂',
    348                                 '<img src="' . $this->png_cdn . '1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
     348                                '<img src="' . self::$png_cdn . '1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
    349349                        ),
    350350                        array(
    351351                                // Skin tone, gender, ZWJ, emoji selector.
    352352                                '👮🏼‍♀️',
    353                                 '<img src="' . $this->png_cdn . '1f46e-1f3fc-200d-2640-fe0f.png" alt="👮🏼‍♀️" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
     353                                '<img src="' . self::$png_cdn . '1f46e-1f3fc-200d-2640-fe0f.png" alt="👮🏼‍♀️" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
    354354                        ),
    355355                        array(
    356356                                // Unicode 10.
    357357                                '🧚',
    358                                 '<img src="' . $this->png_cdn . '1f9da.png" alt="🧚" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
     358                                '<img src="' . self::$png_cdn . '1f9da.png" alt="🧚" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
    359359                        ),
    360360                        array(
    361361                                // Hairy creature (Unicode 17).
    362362                                '🫈',
    363                                 '<img src="' . $this->png_cdn . '1fac8.png" alt="🫈" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
     363                                '<img src="' . self::$png_cdn . '1fac8.png" alt="🫈" class="wp-smiley" style="height: 1em; max-height: 1em;" />',
    364364                        ),
    365365                );
  • trunk/tests/phpunit/tests/formatting/ent2ncr.php

    r56536 r64439  
    2020         * Comments start with "###".
    2121         */
    22         public function data_entities() {
     22        public static function data_entities() {
    2323                $entities      = file( DIR_TESTDATA . '/formatting/entities.txt' );
    2424                $data_provided = array();
  • trunk/tests/phpunit/tests/formatting/escXml.php

    r55562 r64439  
    2828         * }
    2929         */
    30         public function data_esc_xml_basics() {
     30        public static function data_esc_xml_basics() {
    3131                return array(
    3232                        // Simple string.
    … …  
    103103         * }
    104104         */
    105         public function data_ignores_cdata_sections() {
     105        public static function data_ignores_cdata_sections() {
    106106                return array(
    107107                        // basic CDATA Section containing chars that would otherwise be escaped if not in a CDATA Section
  • trunk/tests/phpunit/tests/formatting/excerptRemoveFootnotes.php

    r56244 r64439  
    2525         * @return array
    2626         */
    27         public function data_remove_footnotes() {
     27        public static function data_remove_footnotes() {
    2828                return array(
    2929                        'no footnote'                         => array(
  • trunk/tests/phpunit/tests/formatting/getBloginfo.php

    r55562 r64439  
    2323        }
    2424
    25         public function data_get_bloginfo_language() {
     25        public static function data_get_bloginfo_language() {
    2626                return array(
    2727                        // Locale, language code.
  • trunk/tests/phpunit/tests/formatting/getUrlInContent.php

    r55563 r64439  
    2727         * }
    2828         */
    29         public function data_get_url_in_content() {
     29        public static function data_get_url_in_content() {
    3030                return array(
    3131                        array( // Empty content.
  • trunk/tests/phpunit/tests/formatting/humanTimeDiff.php

    r64342 r64439  
    2020
    2121        // Data for test_human_time_diff.
    22         public function data_human_time_diff() {
     22        public static function data_human_time_diff() {
    2323                return array(
    2424                        array(
    … …  
    9595         * @return array<non-falsy-string, array{ 0: non-negative-int, 1: non-falsy-string }>
    9696         */
    97         public function data_human_time_diff_unit_boundaries(): array {
     97        public static function data_human_time_diff_unit_boundaries(): array {
    9898                return array(
    9999                        'no difference'             => array( 0, '1 second' ),
  • trunk/tests/phpunit/tests/formatting/linksAddBaseUrl.php

    r59163 r64439  
    3535         * }
    3636         */
    37         public function data_links_add_base_url() {
     37        public static function data_links_add_base_url() {
    3838                return array(
    3939                        'https'           => array(
  • trunk/tests/phpunit/tests/formatting/linksAddTarget.php

    r59163 r64439  
    3636         * }
    3737         */
    38         public function data_links_add_target() {
     38        public static function data_links_add_target() {
    3939                return array(
    4040                        array(
  • trunk/tests/phpunit/tests/formatting/makeClickable.php

    r59143 r64439  
    2626         * @return array
    2727         */
    28         public function data_valid_mailto() {
     28        public static function data_valid_mailto() {
    2929                return array(
    3030                        array( 'foo@example.com' ),
    … …  
    5050         * @return array
    5151         */
    52         public function data_invalid_mailto() {
     52        public static function data_invalid_mailto() {
    5353                return array(
    5454                        array( 'foo' ),
    … …  
    8282         * @return array
    8383         */
    84         public function data_urls() {
     84        public static function data_urls() {
    8585                return array(
    8686                        // Does not link trailing periods, commas, and (semi-)colons in URLs with protocol (i.e. http://wordpress.org).
    … …  
    464464        }
    465465
    466         public function data_script_and_style_tags() {
     466        public static function data_script_and_style_tags() {
    467467                return array(
    468468                        array(
    … …  
    500500        }
    501501
    502         public function data_add_rel_ugc_in_comments() {
     502        public static function data_add_rel_ugc_in_comments() {
    503503                $home_url_http  = set_url_scheme( home_url(), 'http' );
    504504                $home_url_https = set_url_scheme( home_url(), 'https' );
  • trunk/tests/phpunit/tests/formatting/maybeHashHexColor.php

    r57735 r64439  
    2727         * @return array[]
    2828         */
    29         public function data_sanitize_hex_color_no_hash() {
     29        public static function data_sanitize_hex_color_no_hash() {
    3030                return array(
    3131                        '$maybe_alpha = false, 3 digit'               => array(
  • trunk/tests/phpunit/tests/formatting/normalizeWhitespace.php

    r62489 r64439  
    2626         * }
    2727         */
    28         public function data_normalize_whitespace() {
     28        public static function data_normalize_whitespace() {
    2929                return array(
    3030                        array(
  • trunk/tests/phpunit/tests/formatting/redirect.php

    r58070 r64439  
    3232        }
    3333
    34         public function data_wp_redirect_bad_status_code() {
     34        public static function data_wp_redirect_bad_status_code() {
    3535                return array(
    3636                        // Tests for bad arguments.
    … …  
    8585        }
    8686
    87         public function data_wp_validate_redirect_valid_url() {
     87        public static function data_wp_validate_redirect_valid_url() {
    8888                return array(
    8989                        array( 'http://example.com', 'http://example.com' ),
    … …  
    113113        }
    114114
    115         public function data_wp_validate_redirect_invalid_url() {
     115        public static function data_wp_validate_redirect_invalid_url() {
    116116                return array(
    117117                        // parse_url() fails.
    … …  
    222222         * }
    223223         */
    224         public function data_wp_validate_redirect_relative_url() {
     224        public static function data_wp_validate_redirect_relative_url() {
    225225                return array(
    226226                        array(
  • trunk/tests/phpunit/tests/formatting/sanitizeEmail.php

    r62829 r64439  
    4040         * @return array[]
    4141         */
    42         public function data_sanitized_email_pairs() {
     42        public static function data_sanitized_email_pairs() {
    4343                return array(
    4444                        'shorter than 6 characters'      => array( 'a@b', '' ),
  • trunk/tests/phpunit/tests/formatting/sanitizeFileName.php

    r60399 r64439  
    9292        }
    9393
    94         public function data_wp_filenames() {
     94        public static function data_wp_filenames() {
    9595                return array(
    9696                        array( urldecode( '%B1myfile.png' ), 'myfile.png' ),
    … …  
    121121         * @return array[]
    122122         */
    123         public function data_sanitize_file_name_should_replace_consecutive_periods_with_a_single_period() {
     123        public static function data_sanitize_file_name_should_replace_consecutive_periods_with_a_single_period() {
    124124                return array(
    125125                        'consecutive periods at the start'         => array(
  • trunk/tests/phpunit/tests/formatting/sanitizeHexColor.php

    r57735 r64439  
    2727         * @return array[]
    2828         */
    29         public function data_sanitize_hex_color() {
     29        public static function data_sanitize_hex_color() {
    3030                return array(
    3131                        '$maybe_alpha = false, 3 digit'               => array(
  • trunk/tests/phpunit/tests/formatting/sanitizeHexColorNoHash.php

    r57735 r64439  
    2727         * @return array[]
    2828         */
    29         public function data_sanitize_hex_color_no_hash() {
     29        public static function data_sanitize_hex_color_no_hash() {
    3030                return array(
    3131                        '$maybe_alpha = false, 3 digit'               => array(
  • trunk/tests/phpunit/tests/formatting/sanitizeKey.php

    r62638 r64439  
    2424         * @return array
    2525         */
    26         public function data_sanitize_key() {
     26        public static function data_sanitize_key() {
    2727                return array(
    2828                        'an empty string key'            => array(
    … …  
    7777         * @return array
    7878         */
    79         public function data_sanitize_key_nonstring_scalar() {
     79        public static function data_sanitize_key_nonstring_scalar() {
    8080                return array(
    8181                        'integer type'  => array(
    … …  
    123123         * @return array
    124124         */
    125         public function data_sanitize_key_with_non_scalars() {
     125        public static function data_sanitize_key_with_non_scalars() {
    126126                return array(
    127127                        'array type' => array(
  • trunk/tests/phpunit/tests/formatting/sanitizeLocaleName.php

    r64122 r64439  
    1414        }
    1515
    16         public function data_sanitize_locale_name_returns_non_empty_string() {
     16        public static function data_sanitize_locale_name_returns_non_empty_string() {
    1717                return array(
    1818                        // array( expected, input )
    … …  
    3838        }
    3939
    40         public function data_sanitize_locale_name_returns_empty_string() {
     40        public static function data_sanitize_locale_name_returns_empty_string() {
    4141                return array(
    4242                        // array( input )
  • trunk/tests/phpunit/tests/formatting/sanitizeOrderby.php

    r55562 r64439  
    1414                $this->assertSame( $orderby, sanitize_sql_orderby( $orderby ) );
    1515        }
    16         public function data_sanitize_sql_orderby_valid() {
     16        public static function data_sanitize_sql_orderby_valid() {
    1717                return array(
    1818                        array( '1' ),
    … …  
    4040                $this->assertFalse( sanitize_sql_orderby( $orderby ) );
    4141        }
    42         public function data_sanitize_sql_orderby_invalid() {
     42        public static function data_sanitize_sql_orderby_invalid() {
    4343                return array(
    4444                        array( '' ),
  • trunk/tests/phpunit/tests/formatting/sanitizeTextField.php

    r64233 r64439  
    2525        }
    2626
    27         public function data_sanitize_text_field() {
     27        public static function data_sanitize_text_field() {
    2828                return array(
    2929                        array(
  • trunk/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php

    r61061 r64439  
    181181         * @return array
    182182         */
    183         public function data_removes_non_visible_characters_without_width() {
     183        public static function data_removes_non_visible_characters_without_width() {
    184184                return array(
    185185                        // Only the non-visible characters.
    … …  
    234234         * @return array
    235235         */
    236         public function data_non_visible_characters_without_width_when_not_save() {
     236        public static function data_non_visible_characters_without_width_when_not_save() {
    237237                return array(
    238238                        // Just the non-visible characters.
    … …  
    286286         * @return array
    287287         */
    288         public function data_converts_non_visible_characters_with_width_to_hyphen() {
     288        public static function data_converts_non_visible_characters_with_width_to_hyphen() {
    289289                return array(
    290290                        // Only the non-visible characters.
    … …  
    344344         * @return array
    345345         */
    346         public function data_non_visible_characters_with_width_to_hyphen_when_not_save() {
     346        public static function data_non_visible_characters_with_width_to_hyphen_when_not_save() {
    347347                return array(
    348348                        // Just the non-visible characters.
  • trunk/tests/phpunit/tests/formatting/sanitizeTrackbackUrls.php

    r55562 r64439  
    1818        }
    1919
    20         public function data_sanitize_trackback_urls_with_multiple_urls() {
     20        public static function data_sanitize_trackback_urls_with_multiple_urls() {
    2121                return array(
    2222                        array( "\r\n\t " ),
  • trunk/tests/phpunit/tests/formatting/urlShorten.php

    r62768 r64439  
    1818        }
    1919
    20         public function data_url_shorten() {
     20        public static function data_url_shorten() {
    2121                // When shortened, the URL is cut to ( $length - 3 ) characters before '&hellip;' is appended.
    2222                return array(
    … …  
    6161        }
    6262
    63         public function data_url_shorten_custom_length() {
     63        public static function data_url_shorten_custom_length() {
    6464                // The URL below is 41 characters long after cleaning.
    6565                $url = 'http://wordpress.org/about/philosophy/#decisions';
  • trunk/tests/phpunit/tests/formatting/urlencodeDeep.php

    r56547 r64439  
    2424         * Data provider.
    2525         */
    26         public function data_urlencode_deep() {
     26        public static function data_urlencode_deep() {
    2727                return array(
    2828                        array( 'qwerty123456', 'qwerty123456' ),
  • trunk/tests/phpunit/tests/formatting/utf8UriEncode.php

    r58235 r64439  
    2626        }
    2727
    28         public function data() {
     28        public static function data() {
    2929                $utf8_urls     = file( DIR_TESTDATA . '/formatting/utf-8/utf-8.txt' );
    3030                $urlencoded    = file( DIR_TESTDATA . '/formatting/utf-8/urlencoded.txt' );
  • trunk/tests/phpunit/tests/formatting/wpAutop.php

    r59784 r64439  
    501501        }
    502502
    503         public function data_element_sanity() {
     503        public static function data_element_sanity() {
    504504                return array(
    505505                        array(
  • trunk/tests/phpunit/tests/formatting/wpHtmlSplit.php

    r54728 r64439  
    1717        }
    1818
    19         public function data_basic_features() {
     19        public static function data_basic_features() {
    2020                return array(
    2121                        array(
    … …  
    5151        }
    5252
    53         public function data_whole_posts() {
     53        public static function data_whole_posts() {
    5454                require_once DIR_TESTDATA . '/formatting/whole-posts.php';
    5555                return data_whole_posts();
  • trunk/tests/phpunit/tests/formatting/wpParseStr.php

    r55563 r64439  
    2929         * @return array
    3030         */
    31         public function data_wp_parse_str() {
     31        public static function data_wp_parse_str() {
    3232                return array(
    3333                        'null'              => array(
    … …  
    104104         * @return array
    105105         */
    106         public function data_wp_parse_str_result_array_is_always_overwritten() {
     106        public static function data_wp_parse_str_result_array_is_always_overwritten() {
    107107                // Standard value for expected output.
    108108                $expected = array(
  • trunk/tests/phpunit/tests/formatting/wpRelNofollow.php

    r60974 r64439  
    3434        }
    3535
    36         public function data_wp_rel_nofollow() {
     36        public static function data_wp_rel_nofollow() {
    3737                $home_url_http  = set_url_scheme( home_url(), 'http' );
    3838                $home_url_https = set_url_scheme( home_url(), 'https' );
  • trunk/tests/phpunit/tests/formatting/wpRelUgc.php

    r60485 r64439  
    3434        }
    3535
    36         public function data_wp_rel_ugc() {
     36        public static function data_wp_rel_ugc() {
    3737                $home_url_http  = set_url_scheme( home_url(), 'http' );
    3838                $home_url_https = set_url_scheme( home_url(), 'https' );
  • trunk/tests/phpunit/tests/formatting/wpReplaceInHtmlTags.php

    r56536 r64439  
    1616        }
    1717
    18         public function data_wp_replace_in_html_tags() {
     18        public static function data_wp_replace_in_html_tags() {
    1919                return array(
    2020                        array(
  • trunk/tests/phpunit/tests/formatting/wpSlash.php

    r61590 r64439  
    3030         * }
    3131         */
    32         public function data_wp_slash() {
     32        public static function data_wp_slash() {
    3333                return array(
    3434                        array( 123, 123 ),
  • trunk/tests/phpunit/tests/formatting/wpSpecialchars.php

    r60251 r64439  
    5959        }
    6060
    61         public function data_double_encoding() {
     61        public static function data_double_encoding() {
    6262                return array(
    6363                        array(
    … …  
    8686        }
    8787
    88         public function data_no_double_encoding() {
     88        public static function data_no_double_encoding() {
    8989                return array(
    9090                        array(
  • trunk/tests/phpunit/tests/formatting/wpStripAllTags.php

    r57735 r64439  
    6464         * @return array[]
    6565         */
    66         public function data_wp_strip_all_tags_should_return_empty_string_and_trigger_an_error_for_non_string_arg() {
     66        public static function data_wp_strip_all_tags_should_return_empty_string_and_trigger_an_error_for_non_string_arg() {
    6767                return array(
    6868                        'an empty array'     => array( 'non_string' => array() ),
    … …  
    9191         * @return array[]
    9292         */
    93         public function data_wp_strip_all_tags_should_cast_scalar_values_to_string() {
     93        public static function data_wp_strip_all_tags_should_cast_scalar_values_to_string() {
    9494                return array(
    9595                        '(int) 0'      => array( 'text' => 0 ),
  • trunk/tests/phpunit/tests/formatting/wpTexturize.php

    r63934 r64439  
    272272        }
    273273
    274         public function data_spaces_around_quotes() {
     274        public static function data_spaces_around_quotes() {
    275275                $nbsp = "\xC2\xA0";
    276276                $pi   = "\xCE\xA0";
    … …  
    328328        }
    329329
    330         public function data_apos_before_digits() {
     330        public static function data_apos_before_digits() {
    331331                return array(
    332332                        array(
    … …  
    369369        }
    370370
    371         public function data_opening_single_quote() {
     371        public static function data_opening_single_quote() {
    372372                return array(
    373373                        array(
    … …  
    498498        }
    499499
    500         public function data_double_prime() {
     500        public static function data_double_prime() {
    501501                return array(
    502502                        array(
    … …  
    531531        }
    532532
    533         public function data_single_prime() {
     533        public static function data_single_prime() {
    534534                return array(
    535535                        array(
    … …  
    564564        }
    565565
    566         public function data_contractions() {
     566        public static function data_contractions() {
    567567                return array(
    568568                        array(
    … …  
    605605        }
    606606
    607         public function data_opening_quote() {
     607        public static function data_opening_quote() {
    608608                return array(
    609609                        array(
    … …  
    682682        }
    683683
    684         public function data_closing_quote() {
     684        public static function data_closing_quote() {
    685685                return array(
    686686                        array(
    … …  
    771771        }
    772772
    773         public function data_closing_single_quote() {
     773        public static function data_closing_single_quote() {
    774774                return array(
    775775                        array(
    … …  
    861861        }
    862862
    863         public function data_multiplication() {
     863        public static function data_multiplication() {
    864864                return array(
    865865                        array(
    … …  
    911911        }
    912912
    913         public function data_ampersand() {
     913        public static function data_ampersand() {
    914914                return array(
    915915                        array(
    … …  
    976976        }
    977977
    978         public function data_cockney() {
     978        public static function data_cockney() {
    979979                return array(
    980980                        array(
    … …  
    10371037        }
    10381038
    1039         public function data_smart_dashes() {
     1039        public static function data_smart_dashes() {
    10401040                return array(
    10411041                        array(
    … …  
    10901090        }
    10911091
    1092         public function data_misc_static_replacements() {
     1092        public static function data_misc_static_replacements() {
    10931093                return array(
    10941094                        array(
    … …  
    11451145        }
    11461146
    1147         public function data_quoted_numbers() {
     1147        public static function data_quoted_numbers() {
    11481148                return array(
    11491149                        array(
    … …  
    11961196        }
    11971197
    1198         public function data_quotes_and_dashes() {
     1198        public static function data_quotes_and_dashes() {
    11991199                return array(
    12001200                        array(
    … …  
    12591259        }
    12601260
    1261         public function data_tag_avoidance() {
     1261        public static function data_tag_avoidance() {
    12621262                return array(
    12631263                        array(
    … …  
    14821482        }
    14831483
    1484         public function data_year_abbr() {
     1484        public static function data_year_abbr() {
    14851485                return array(
    14861486                        array(
    … …  
    16071607        }
    16081608
    1609         public function data_translate() {
     1609        public static function data_translate() {
    16101610                return array(
    16111611                        array(
    … …  
    17981798        }
    17991799
    1800         public function data_element_stack() {
     1800        public static function data_element_stack() {
    18011801                return array(
    18021802                        array(
    … …  
    18591859        }
    18601860
    1861         public function data_unregistered_shortcodes() {
     1861        public static function data_unregistered_shortcodes() {
    18621862                return array(
    18631863                        array(
    … …  
    19341934        }
    19351935
    1936         public function data_primes_vs_quotes() {
     1936        public static function data_primes_vs_quotes() {
    19371937                return array(
    19381938                        array(
    … …  
    20302030        }
    20312031
    2032         public function data_primes_quotes_translation() {
     2032        public static function data_primes_quotes_translation() {
    20332033                return array(
    20342034                        array(
    … …  
    21122112        }
    21132113
    2114         public function data_whole_posts() {
     2114        public static function data_whole_posts() {
    21152115                require_once DIR_TESTDATA . '/formatting/whole-posts.php';
    21162116                return data_whole_posts();
  • trunk/tests/phpunit/tests/formatting/wpTruncateSlug.php

    r63909 r64439  
    3030         * @return array[]
    3131         */
    32         public function data_wp_truncate_slug_should_truncate() {
     32        public static function data_wp_truncate_slug_should_truncate() {
    3333                return array(
    3434                        'a slug that is too long'                      => array(
Note: See TracChangeset for help on using the changeset viewer.