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/menu/nav-menu.php

    r51568 r52010  
    99     * Set up.
    1010     */
    11     function set_up() {
     11    public function set_up() {
    1212        parent::set_up();
    1313
     
    2323     * @param array $locations Location slugs.
    2424     */
    25     function register_nav_menu_locations( $locations ) {
     25    private function register_nav_menu_locations( $locations ) {
    2626        foreach ( $locations as $location ) {
    2727            register_nav_menu( $location, ucfirst( $location ) );
     
    3434     * @covers ::wp_map_nav_menu_locations
    3535     */
    36     function test_one_location_each() {
     36    public function test_one_location_each() {
    3737        $this->register_nav_menu_locations( array( 'primary' ) );
    3838        $prev_theme_nav_menu_locations     = array(
     
    5353     * @covers ::wp_map_nav_menu_locations
    5454     */
    55     function test_filter_registered_locations() {
     55    public function test_filter_registered_locations() {
    5656        $this->register_nav_menu_locations( array( 'primary', 'secondary' ) );
    5757        $prev_theme_nav_menu_locations     = array(
     
    7575     * @covers ::wp_map_nav_menu_locations
    7676     */
    77     function test_locations_with_same_slug() {
     77    public function test_locations_with_same_slug() {
    7878        $this->register_nav_menu_locations( array( 'primary', 'secondary' ) );
    7979        $prev_theme_nav_menu_locations = array(
     
    9494     * @covers ::wp_map_nav_menu_locations
    9595     */
    96     function test_new_theme_previously_active() {
     96    public function test_new_theme_previously_active() {
    9797        $this->register_nav_menu_locations( array( 'primary' ) );
    9898
     
    118118     * @covers ::wp_map_nav_menu_locations
    119119     */
    120     function test_location_guessing() {
     120    public function test_location_guessing() {
    121121        $this->register_nav_menu_locations( array( 'primary', 'secondary' ) );
    122122
     
    141141     * @covers ::wp_map_nav_menu_locations
    142142     */
    143     function test_location_guessing_one_menu_per_group() {
     143    public function test_location_guessing_one_menu_per_group() {
    144144        $this->register_nav_menu_locations( array( 'primary' ) );
    145145        $prev_theme_nav_menu_locations = array(
     
    162162     * @covers ::wp_map_nav_menu_locations
    163163     */
    164     function test_location_guessing_one_menu_per_location() {
     164    public function test_location_guessing_one_menu_per_location() {
    165165        $this->register_nav_menu_locations( array( 'primary', 'main' ) );
    166166
     
    187187     * @covers ::wp_map_nav_menu_locations
    188188     */
    189     function test_numerical_locations() {
     189    public function test_numerical_locations() {
    190190        $this->register_nav_menu_locations( array( 'primary', 1 ) );
    191191
Note: See TracChangeset for help on using the changeset viewer.