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

    r50192 r52010  
    88class Tests_Basic extends WP_UnitTestCase {
    99
    10     function test_license() {
     10    public function test_license() {
    1111        // This test is designed to only run on trunk/master.
    1212        $this->skipOnAutomatedBranches();
     
    1818    }
    1919
    20     function test_security_md() {
     20    public function test_security_md() {
    2121        // This test is designed to only run on trunk/master.
    2222        $this->skipOnAutomatedBranches();
     
    2929    }
    3030
    31     function test_package_json() {
     31    public function test_package_json() {
    3232        $package_json    = file_get_contents( dirname( ABSPATH ) . '/package.json' );
    3333        $package_json    = json_decode( $package_json, true );
     
    4444     * @depends test_package_json
    4545     */
    46     function test_package_json_node_engine( $package_json ) {
     46    public function test_package_json_node_engine( $package_json ) {
    4747        $this->assertArrayHasKey( 'engines', $package_json );
    4848        $this->assertArrayHasKey( 'node', $package_json['engines'] );
     
    5151    // Test some helper utility functions.
    5252
    53     function test_strip_ws() {
     53    public function test_strip_ws() {
    5454        $this->assertSame( '', strip_ws( '' ) );
    5555        $this->assertSame( 'foo', strip_ws( 'foo' ) );
     
    7878    }
    7979
    80     function test_mask_input_value() {
     80    public function test_mask_input_value() {
    8181        $in = <<<EOF
    8282<h2>Assign Authors</h2>
Note: See TracChangeset for help on using the changeset viewer.