Make WordPress Core


Ignore:
Timestamp:
03/19/2023 12:03:30 PM (21 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use the data_ prefix for various data provider methods.

This aims to bring more consistency to the test suite, as the vast majority of data providers already use that prefix.

Includes moving some data providers next to the tests they are used in.

Follow-up to [55464].

See #57841.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/http/http.php

    r55370 r55562  
    1313     * @ticket 56231
    1414     *
    15      * @dataProvider make_absolute_url_testcases
     15     * @dataProvider data_make_absolute_url
    1616     *
    1717     * @covers WP_Http::make_absolute_url
     
    2222    }
    2323
    24     public function make_absolute_url_testcases() {
     24    public function data_make_absolute_url() {
    2525        // 0: The Location header, 1: The current URL, 3: The expected URL.
    2626        return array(
     
    8181
    8282    /**
    83      * @dataProvider parse_url_testcases
     83     * @dataProvider data_wp_parse_url
    8484     *
    8585     * @covers ::wp_parse_url
     
    9090    }
    9191
    92     public function parse_url_testcases() {
     92    public function data_wp_parse_url() {
    9393        // 0: The URL, 1: The expected resulting structure.
    9494        return array(
     
    218218     * @ticket 36356
    219219     *
    220      * @dataProvider parse_url_component_testcases
     220     * @dataProvider data_wp_parse_url_with_component
    221221     *
    222222     * @covers ::wp_parse_url
     
    227227    }
    228228
    229     public function parse_url_component_testcases() {
     229    public function data_wp_parse_url_with_component() {
    230230        // 0: The URL, 1: The requested component, 2: The expected resulting structure.
    231231        return array(
     
    334334     * @ticket 36356
    335335     *
    336      * @dataProvider get_component_from_parsed_url_array_testcases
     336     * @dataProvider data_get_component_from_parsed_url_array
    337337     *
    338338     * @covers ::wp_parse_url
     
    345345    }
    346346
    347     public function get_component_from_parsed_url_array_testcases() {
     347    public function data_get_component_from_parsed_url_array() {
    348348        // 0: A URL, 1: PHP URL constant, 2: The expected result.
    349349        return array(
     
    376376     * @ticket 36356
    377377     *
    378      * @dataProvider wp_translate_php_url_constant_to_key_testcases
     378     * @dataProvider data_wp_translate_php_url_constant_to_key
    379379     *
    380380     * @covers ::_wp_translate_php_url_constant_to_key
     
    385385    }
    386386
    387     public function wp_translate_php_url_constant_to_key_testcases() {
     387    public function data_wp_translate_php_url_constant_to_key() {
    388388        // 0: PHP URL constant, 1: The expected result.
    389389        return array(
Note: See TracChangeset for help on using the changeset viewer.