Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (3 years ago)
Author:
hellofromTonya
Message:

Coding Standards: Add visibility to methods in tests/phpunit/tests/.

Adds a public visibility to test fixtures, tests, data providers, and callbacks methods.

Adds a private visibility to helper methods within test classes.

Renames callbacks and helpers that previously started with a _ prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit.

Props costdev, jrf, hellofromTonya.
Fixes #54177.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/wpHtmlSplit.php

    r51623 r52010  
    1111     * @dataProvider data_basic_features
    1212     */
    13     function test_basic_features( $input, $output ) {
     13    public function test_basic_features( $input, $output ) {
    1414        return $this->assertSame( $output, wp_html_split( $input ) );
    1515    }
    1616
    17     function data_basic_features() {
     17    public function data_basic_features() {
    1818        return array(
    1919            array(
     
    4141     * @dataProvider data_whole_posts
    4242     */
    43     function test_pcre_performance( $input ) {
     43    public function test_pcre_performance( $input ) {
    4444        $regex  = get_html_split_regex();
    4545        $result = benchmark_pcre_backtracking( $regex, $input, 'split' );
     
    4747    }
    4848
    49     function data_whole_posts() {
     49    public function data_whole_posts() {
    5050        require_once DIR_TESTDATA . '/formatting/whole-posts.php';
    5151        return data_whole_posts();
Note: See TracChangeset for help on using the changeset viewer.