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/formatting/getUrlInContent.php

    r53562 r55562  
    99
    1010    /**
     11     * Validate the get_url_in_content function
     12     *
     13     * @dataProvider data_get_url_in_content
     14     */
     15    public function test_get_url_in_content( $in_str, $exp_str ) {
     16        $this->assertSame( $exp_str, get_url_in_content( $in_str ) );
     17    }
     18
     19    /**
    1120     * URL Content Data Provider
    1221     *
    1322     * array ( input_txt, converted_output_txt )
    1423     */
    15     public function get_input_output() {
     24    public function data_get_url_in_content() {
    1625        return array(
    1726            array( // Empty content.
     
    4150        );
    4251    }
    43 
    44     /**
    45      * Validate the get_url_in_content function
    46      *
    47      * @dataProvider get_input_output
    48      */
    49     public function test_get_url_in_content( $in_str, $exp_str ) {
    50         $this->assertSame( $exp_str, get_url_in_content( $in_str ) );
    51     }
    5252}
Note: See TracChangeset for help on using the changeset viewer.