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/ajax/CustomizeMenus.php

    r51568 r52010  
    8181     * @param array  $expected_results  Expected results.
    8282     */
    83     function test_ajax_load_available_items_cap_check( $role, $expected_results ) {
     83    public function test_ajax_load_available_items_cap_check( $role, $expected_results ) {
    8484
    8585        if ( 'administrator' !== $role ) {
     
    123123     * }
    124124     */
    125     function data_ajax_load_available_items_cap_check() {
     125    public function data_ajax_load_available_items_cap_check() {
    126126        return array(
    127127            array(
     
    159159     * @param mixed $expected_results Expected results.
    160160     */
    161     function test_ajax_load_available_items_error_messages( $post_args, $expected_results ) {
     161    public function test_ajax_load_available_items_error_messages( $post_args, $expected_results ) {
    162162
    163163        $_POST = array_merge(
     
    193193     * }
    194194     */
    195     function data_ajax_load_available_items_error_messages() {
     195    public function data_ajax_load_available_items_error_messages() {
    196196        return array(
    197197            // Testing empty obj_type and type.
     
    269269     * @param array $success_status  Success status.
    270270     */
    271     function test_ajax_load_available_items_success_status( $post_args, $success_status ) {
     271    public function test_ajax_load_available_items_success_status( $post_args, $success_status ) {
    272272
    273273        $_POST = array_merge(
     
    303303     * }
    304304     */
    305     function data_ajax_load_available_items_success_status() {
     305    public function data_ajax_load_available_items_success_status() {
    306306        return array(
    307307            array(
     
    359359     * @param array $post_args POST args.
    360360     */
    361     function test2_ajax_load_available_items_structure( $post_args ) {
     361    public function test2_ajax_load_available_items_structure( $post_args ) {
    362362        do_action( 'customize_register', $this->wp_customize );
    363363
     
    437437     * }
    438438     */
    439     function data_ajax_load_available_items_structure() {
     439    public function data_ajax_load_available_items_structure() {
    440440        return array(
    441441            array(
     
    468468     * @param array  $expected_results Expected results.
    469469     */
    470     function test_ajax_search_available_items_caps_check( $role, $expected_results ) {
     470    public function test_ajax_search_available_items_caps_check( $role, $expected_results ) {
    471471
    472472        if ( 'administrator' !== $role ) {
     
    511511     * }
    512512     */
    513     function data_ajax_search_available_items_caps_check() {
     513    public function data_ajax_search_available_items_caps_check() {
    514514        return array(
    515515            array(
     
    547547     * @param array $expected_results Expected results.
    548548     */
    549     function test_ajax_search_available_items_results( $post_args, $expected_results ) {
     549    public function test_ajax_search_available_items_results( $post_args, $expected_results ) {
    550550        do_action( 'customize_register', $this->wp_customize );
    551551
     
    603603     * }
    604604     */
    605     function data_ajax_search_available_items_results() {
     605    public function data_ajax_search_available_items_results() {
    606606        return array(
    607607            array(
     
    640640     * @covers WP_Customize_Nav_Menus::ajax_insert_auto_draft_post
    641641     */
    642     function test_ajax_insert_auto_draft_post_success() {
     642    public function test_ajax_insert_auto_draft_post_success() {
    643643        $_POST                = wp_slash(
    644644            array(
     
    670670     * @covers WP_Customize_Nav_Menus::ajax_insert_auto_draft_post
    671671     */
    672     function test_ajax_insert_auto_draft_failures() {
     672    public function test_ajax_insert_auto_draft_failures() {
    673673        // No nonce.
    674674        $_POST                = array();
Note: See TracChangeset for help on using the changeset viewer.