Make WordPress Core


Ignore:
Timestamp:
03/19/2023 12:03:30 PM (22 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/shortcode.php

    r55119 r55562  
    405405    }
    406406
    407     public function data_test_strip_shortcodes() {
     407    /**
     408     * @ticket 10326
     409     *
     410     * @dataProvider data_strip_shortcodes
     411     *
     412     * @param string $expected  Expected output.
     413     * @param string $content   Content to run strip_shortcodes() on.
     414     */
     415    public function test_strip_shortcodes( $expected, $content ) {
     416        $this->assertSame( $expected, strip_shortcodes( $content ) );
     417    }
     418
     419    public function data_strip_shortcodes() {
    408420        return array(
    409421            array( 'before', 'before[gallery]' ),
     
    421433
    422434    /**
    423      * @ticket 10326
    424      *
    425      * @dataProvider data_test_strip_shortcodes
    426      *
    427      * @param string $expected  Expected output.
    428      * @param string $content   Content to run strip_shortcodes() on.
    429      */
    430     public function test_strip_shortcodes( $expected, $content ) {
    431         $this->assertSame( $expected, strip_shortcodes( $content ) );
    432     }
    433 
    434     /**
    435435     * @ticket 37767
    436436     */
Note: See TracChangeset for help on using the changeset viewer.