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/comment/getCommentsPagesCount.php

    r51568 r52010  
    1414     * setUp options
    1515     */
    16     function set_up() {
     16    public function set_up() {
    1717        parent::set_up();
    1818        $this->option_page_comments = get_option( 'page_comments' );
     
    2727     * tearDown options
    2828     */
    29     function tear_down() {
     29    public function tear_down() {
    3030        update_option( 'page_comments', $this->option_page_comments );
    3131        update_option( 'comments_per_page', $this->option_page_comments );
     
    3838     * Validate get_comments_pages_count for empty comments
    3939     */
    40     function test_empty() {
     40    public function test_empty() {
    4141        // Setup post and comments.
    4242        $post_id = self::factory()->post->create(
     
    6565     * Validate get_comments_pages_count for treaded comments
    6666     */
    67     function test_threaded_comments() {
     67    public function test_threaded_comments() {
    6868        // Setup post and comments.
    6969        $post     = self::factory()->post->create_and_get(
     
    8585     * Validate get_comments_pages_count for option tread_comments
    8686     */
    87     function test_option_thread_comments() {
     87    public function test_option_thread_comments() {
    8888
    8989        // Setup post and comments.
     
    116116     * Validate $wp_query logic of get_comment_pages_count
    117117     */
    118     function test_wp_query_comments_per_page() {
     118    public function test_wp_query_comments_per_page() {
    119119        global $wp_query;
    120120
     
    165165     * Validate max_num_comment_pages logic of get_comment_pages_count
    166166     */
    167     function test_max_num_comment_pages() {
     167    public function test_max_num_comment_pages() {
    168168        global $wp_query;
    169169        $wp_query = new WP_Query();
Note: See TracChangeset for help on using the changeset viewer.