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/normalizeWhitespace.php

    r53562 r55562  
    66 */
    77class Tests_Formatting_NormalizeWhitespace extends WP_UnitTestCase {
     8
     9    /**
     10     * Validate the normalize_whitespace function
     11     *
     12     * @dataProvider data_normalize_whitespace
     13     */
     14    public function test_normalize_whitespace( $in_str, $exp_str ) {
     15        $this->assertSame( $exp_str, normalize_whitespace( $in_str ) );
     16    }
     17
    818    /**
    919     * WhitespaceTest Content DataProvider
     
    1121     * array( input_txt, converted_output_txt)
    1222     */
    13     public function get_input_output() {
     23    public function data_normalize_whitespace() {
    1424        return array(
    1525            array(
     
    4353        );
    4454    }
    45 
    46     /**
    47      * Validate the normalize_whitespace function
    48      *
    49      * @dataProvider get_input_output
    50      */
    51     public function test_normalize_whitespace( $in_str, $exp_str ) {
    52         $this->assertSame( $exp_str, normalize_whitespace( $in_str ) );
    53     }
    5455}
Note: See TracChangeset for help on using the changeset viewer.