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/rest-api/rest-posts-controller.php

    r55457 r55562  
    23582358    }
    23592359
    2360     public function post_dates_provider() {
     2360    public function data_post_dates() {
    23612361        $all_statuses = array(
    23622362            'draft',
     
    24292429
    24302430    /**
    2431      * @dataProvider post_dates_provider
     2431     * @dataProvider data_post_dates
    24322432     */
    24332433    public function test_create_post_date( $status, $params, $results ) {
     
    34783478
    34793479    /**
    3480      * @dataProvider post_dates_provider
     3480     * @dataProvider data_post_dates
    34813481     */
    34823482    public function test_update_post_date( $status, $params, $results ) {
     
    40334033    }
    40344034
    4035     public static function post_roundtrip_provider() {
     4035    /**
     4036     * @dataProvider data_post_roundtrip_as_author
     4037     */
     4038    public function test_post_roundtrip_as_author( $raw, $expected ) {
     4039        wp_set_current_user( self::$author_id );
     4040
     4041        $this->assertFalse( current_user_can( 'unfiltered_html' ) );
     4042        $this->verify_post_roundtrip( $raw, $expected );
     4043    }
     4044
     4045    public static function data_post_roundtrip_as_author() {
    40364046        return array(
    40374047            array(
     
    41284138            ),
    41294139        );
    4130     }
    4131 
    4132     /**
    4133      * @dataProvider post_roundtrip_provider
    4134      */
    4135     public function test_post_roundtrip_as_author( $raw, $expected ) {
    4136         wp_set_current_user( self::$author_id );
    4137 
    4138         $this->assertFalse( current_user_can( 'unfiltered_html' ) );
    4139         $this->verify_post_roundtrip( $raw, $expected );
    41404140    }
    41414141
Note: See TracChangeset for help on using the changeset viewer.