Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (5 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/option/wpLoadAllOptions.php

    r51568 r52010  
    88        protected $alloptions = null;
    99
    10         function tear_down() {
     10        public function tear_down() {
    1111                $this->alloptions = null;
    1212                parent::tear_down();
    1313        }
    1414
    15         function test_if_alloptions_is_cached() {
     15        public function test_if_alloptions_is_cached() {
    1616                $this->assertNotEmpty( wp_cache_get( 'alloptions', 'options' ) );
    1717        }
    … …  
    2020         * @depends test_if_alloptions_is_cached
    2121         */
    22         function test_if_cached_alloptions_is_deleted() {
     22        public function test_if_cached_alloptions_is_deleted() {
    2323                $this->assertTrue( wp_cache_delete( 'alloptions', 'options' ) );
    2424        }
    … …  
    2727         * @depends test_if_alloptions_is_cached
    2828         */
    29         function test_if_alloptions_are_retrieved_from_cache() {
     29        public function test_if_alloptions_are_retrieved_from_cache() {
    3030                global $wpdb;
    3131                $before = $wpdb->num_queries;
    … …  
    4040         * @depends test_if_cached_alloptions_is_deleted
    4141         */
    42         function test_if_alloptions_are_retrieved_from_database() {
     42        public function test_if_alloptions_are_retrieved_from_database() {
    4343                global $wpdb;
    4444
    … …  
    5757         * @depends test_if_cached_alloptions_is_deleted
    5858         */
    59         function test_filter_pre_cache_alloptions_is_called() {
     59        public function test_filter_pre_cache_alloptions_is_called() {
    6060                $temp = wp_installing();
    6161
    … …  
    8383         * @depends test_if_alloptions_is_cached
    8484         */
    85         function test_filter_pre_cache_alloptions_is_not_called() {
     85        public function test_filter_pre_cache_alloptions_is_not_called() {
    8686                $temp = wp_installing();
    8787
    … …  
    104104        }
    105105
    106         function return_pre_cache_filter( $alloptions ) {
     106        public function return_pre_cache_filter( $alloptions ) {
    107107                $this->alloptions = $alloptions;
    108108                return $this->alloptions;
Note: See TracChangeset for help on using the changeset viewer.