Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (9 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/getCommentsPagesCount.php

    r42228 r42343  
    22/**
    33 * Validate the logic of get_comments_pages_count
     4 *
    45 * @group comment
    56 */
    … …  
    3940        function test_empty() {
    4041                //setup post and comments
    41                 $post_id = self::factory()->post->create( array( 'post_title' => 'comment--post', 'post_type' => 'post' ) );
     42                $post_id = self::factory()->post->create(
     43                        array(
     44                                'post_title' => 'comment--post',
     45                                'post_type'  => 'post',
     46                        )
     47                );
    4248                $this->go_to( '/?p=' . $post_id );
    4349
    … …  
    5965         * Validate get_comments_pages_count for treaded comments
    6066         */
    61         function test_threaded_comments( ) {
     67        function test_threaded_comments() {
    6268                //setup post and comments
    63                 $post = self::factory()->post->create_and_get( array( 'post_title' => 'comment--post', 'post_type' => 'post' ) );
     69                $post     = self::factory()->post->create_and_get(
     70                        array(
     71                                'post_title' => 'comment--post',
     72                                'post_type'  => 'post',
     73                        )
     74                );
    6475                $comments = self::factory()->comment->create_post_comments( $post->ID, 15 );
    6576                self::factory()->comment->create_post_comments( $post->ID, 6, array( 'comment_parent' => $comments[0] ) );
    … …  
    7788
    7889                //setup post and comments
    79                 $post = self::factory()->post->create_and_get( array( 'post_title' => 'comment--post', 'post_type' => 'post' ) );
     90                $post     = self::factory()->post->create_and_get(
     91                        array(
     92                                'post_title' => 'comment--post',
     93                                'post_type'  => 'post',
     94                        )
     95                );
    8096                $comments = self::factory()->comment->create_post_comments( $post->ID, 15 );
    81                 self::factory()->comment->create_post_comments( $post->ID, 6, array('comment_parent' => $comments[0] ) );
     97                self::factory()->comment->create_post_comments( $post->ID, 6, array( 'comment_parent' => $comments[0] ) );
    8298                $comments = get_comments( array( 'post_id' => $post->ID ) );
    8399
    … …  
    105121                update_option( 'posts_per_rss', 100 );
    106122
    107                 $post = self::factory()->post->create_and_get( array( 'post_title' => 'comment-post', 'post_type' => 'post' ) );
     123                $post     = self::factory()->post->create_and_get(
     124                        array(
     125                                'post_title' => 'comment-post',
     126                                'post_type'  => 'post',
     127                        )
     128                );
    108129                $comments = self::factory()->comment->create_post_comments( $post->ID, 25 );
    109130
    110                 $wp_query = new WP_Query( array( 'p' => $post->ID, 'comments_per_page' => 10, 'feed' =>'comments-' ) );
     131                $wp_query = new WP_Query(
     132                        array(
     133                                'p'                 => $post->ID,
     134                                'comments_per_page' => 10,
     135                                'feed'              => 'comments-',
     136                        )
     137                );
    111138
    112139                update_option( 'comments_per_page', 25 );
    … …  
    115142                $this->assertEquals( 2, get_comment_pages_count( null, 20 ) );
    116143
    117                 $wp_query = new WP_Query( array( 'p' => $post->ID,'comments_per_page' => null, 'feed' =>'comments-' ) );
     144                $wp_query = new WP_Query(
     145                        array(
     146                                'p'                 => $post->ID,
     147                                'comments_per_page' => null,
     148                                'feed'              => 'comments-',
     149                        )
     150                );
    118151
    119152                $this->assertEquals( 1, get_comment_pages_count() );
Note: See TracChangeset for help on using the changeset viewer.