Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 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/wpCountComments.php

    r35242 r42343  
    1616
    1717    public function test_wp_count_comments_approved() {
    18         self::factory()->comment->create( array(
    19             'comment_approved' => 1
    20         ) );
     18        self::factory()->comment->create(
     19            array(
     20                'comment_approved' => 1,
     21            )
     22        );
    2123
    2224        $count = wp_count_comments();
     
    3234
    3335    public function test_wp_count_comments_awaiting() {
    34         self::factory()->comment->create( array(
    35             'comment_approved' => 0
    36         ) );
     36        self::factory()->comment->create(
     37            array(
     38                'comment_approved' => 0,
     39            )
     40        );
    3741
    3842        $count = wp_count_comments();
     
    4852
    4953    public function test_wp_count_comments_spam() {
    50         self::factory()->comment->create( array(
    51             'comment_approved' => 'spam'
    52         ) );
     54        self::factory()->comment->create(
     55            array(
     56                'comment_approved' => 'spam',
     57            )
     58        );
    5359
    5460        $count = wp_count_comments();
     
    6470
    6571    public function test_wp_count_comments_trash() {
    66         self::factory()->comment->create( array(
    67             'comment_approved' => 'trash'
    68         ) );
     72        self::factory()->comment->create(
     73            array(
     74                'comment_approved' => 'trash',
     75            )
     76        );
    6977
    7078        $count = wp_count_comments();
     
    8088
    8189    public function test_wp_count_comments_post_trashed() {
    82         self::factory()->comment->create( array(
    83             'comment_approved' => 'post-trashed'
    84         ) );
     90        self::factory()->comment->create(
     91            array(
     92                'comment_approved' => 'post-trashed',
     93            )
     94        );
    8595
    8696        $count = wp_count_comments();
     
    96106
    97107    public function test_wp_count_comments_cache() {
    98         $post_id = self::factory()->post->create( array(
    99             'post_status' => 'publish'
    100         ) );
    101         $comment_id = self::factory()->comment->create( array(
    102             'comment_approved' => '1',
    103             'comment_post_ID' => $post_id
    104         ) );
     108        $post_id    = self::factory()->post->create(
     109            array(
     110                'post_status' => 'publish',
     111            )
     112        );
     113        $comment_id = self::factory()->comment->create(
     114            array(
     115                'comment_approved' => '1',
     116                'comment_post_ID'  => $post_id,
     117            )
     118        );
    105119
    106120        $count1 = wp_count_comments( $post_id );
Note: See TracChangeset for help on using the changeset viewer.