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

    r55464 r55562  
    17681768     *
    17691769     * @ticket 42016
    1770      * @dataProvider data_test_validate_file
     1770     * @dataProvider data_validate_file
    17711771     *
    17721772     * @param string $file          File path.
     
    17891789     * }
    17901790     */
    1791     public function data_test_validate_file() {
     1791    public function data_validate_file() {
    17921792        return array(
    17931793
     
    19111911     * Test stream URL validation.
    19121912     *
    1913      * @dataProvider data_test_wp_is_stream
     1913     * @dataProvider data_wp_is_stream
    19141914     *
    19151915     * @param string $path     The resource path or URL.
     
    19341934     * }
    19351935     */
    1936     public function data_test_wp_is_stream() {
     1936    public function data_wp_is_stream() {
    19371937        return array(
    19381938            // Legitimate stream examples.
     
    19551955     *
    19561956     * @ticket 39667
    1957      * @dataProvider data_test_human_readable_duration
     1957     * @dataProvider data_human_readable_duration
    19581958     *
    19591959     * @param string $input    Duration.
     
    19741974     * }
    19751975     */
    1976     public function data_test_human_readable_duration() {
     1976    public function data_human_readable_duration() {
    19771977        return array(
    19781978            // Valid ii:ss cases.
     
    20312031    /**
    20322032     * @ticket 49404
    2033      * @dataProvider data_test_wp_is_json_media_type
     2033     * @dataProvider data_wp_is_json_media_type
    20342034     */
    20352035    public function test_wp_is_json_media_type( $input, $expected ) {
     
    20382038
    20392039
    2040     public function data_test_wp_is_json_media_type() {
     2040    public function data_wp_is_json_media_type() {
    20412041        return array(
    20422042            array( 'application/ld+json', true ),
Note: See TracChangeset for help on using the changeset viewer.