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/ajax/EditComment.php

    r35242 r42343  
    1818    /**
    1919     * A post with at least one comment
     20     *
    2021     * @var mixed
    2122     */
     
    3536     * Get comments as a privilged user (administrator)
    3637     * Expects test to pass
     38     *
    3739     * @return void
    3840     */
     
    4345
    4446        // Get a comment
    45         $comments = get_comments( array(
    46             'post_id' => $this->_comment_post->ID
    47         ) );
    48         $comment = array_pop( $comments );
     47        $comments = get_comments(
     48            array(
     49                'post_id' => $this->_comment_post->ID,
     50            )
     51        );
     52        $comment  = array_pop( $comments );
    4953
    5054        // Set up a default request
     
    8589
    8690        // Get a comment
    87         $comments = get_comments( array(
    88             'post_id' => $this->_comment_post->ID
    89         ) );
    90         $comment = array_pop( $comments );
     91        $comments = get_comments(
     92            array(
     93                'post_id' => $this->_comment_post->ID,
     94            )
     95        );
     96        $comment  = array_pop( $comments );
    9197
    9298        // Manually update the comment_post_ID, because wp_update_comment() will prevent it.
     
    124130     * Get comments as a non-privileged user (subscriber)
    125131     * Expects test to fail
     132     *
    126133     * @return void
    127134     */
     
    132139
    133140        // Get a comment
    134         $comments = get_comments( array(
    135             'post_id' => $this->_comment_post->ID
    136         ) );
    137         $comment = array_pop( $comments );
     141        $comments = get_comments(
     142            array(
     143                'post_id' => $this->_comment_post->ID,
     144            )
     145        );
     146        $comment  = array_pop( $comments );
    138147
    139148        // Set up a default request
     
    150159     * Get comments with a bad nonce
    151160     * Expects test to fail
     161     *
    152162     * @return void
    153163     */
     
    158168
    159169        // Get a comment
    160         $comments = get_comments( array(
    161             'post_id' => $this->_comment_post->ID
    162         ) );
    163         $comment = array_pop( $comments );
     170        $comments = get_comments(
     171            array(
     172                'post_id' => $this->_comment_post->ID,
     173            )
     174        );
     175        $comment  = array_pop( $comments );
    164176
    165177        // Set up a default request
     
    176188     * Get comments for an invalid post
    177189     * This should return valid XML
     190     *
    178191     * @return void
    179192     */
Note: See TracChangeset for help on using the changeset viewer.