Make WordPress Core


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

    r40417 r42343  
    99        $this->make_user_by_role( 'administrator' );
    1010        $post = self::factory()->post->create_and_get();
    11  
    12         $result = $this->myxmlrpcserver->wp_newComment( array( 1, 'administrator', 'administrator', $post->ID, array(
    13             'content' => rand_str( 100 )
    14         ) ) );
    15  
     11
     12        $result = $this->myxmlrpcserver->wp_newComment(
     13            array(
     14                1,
     15                'administrator',
     16                'administrator',
     17                $post->ID,
     18                array(
     19                    'content' => rand_str( 100 ),
     20                ),
     21            )
     22        );
     23
    1624        $this->assertNotIXRError( $result );
    1725    }
    18  
     26
    1927    function test_empty_comment() {
    2028        $this->make_user_by_role( 'administrator' );
    2129        $post = self::factory()->post->create_and_get();
    22  
    23         $result = $this->myxmlrpcserver->wp_newComment( array( 1, 'administrator', 'administrator', $post->ID, array(
    24             'content' => ''
    25         ) ) );
    26  
     30
     31        $result = $this->myxmlrpcserver->wp_newComment(
     32            array(
     33                1,
     34                'administrator',
     35                'administrator',
     36                $post->ID,
     37                array(
     38                    'content' => '',
     39                ),
     40            )
     41        );
     42
    2743        $this->assertIXRError( $result );
    2844        $this->assertEquals( 403, $result->code );
     
    3147    function test_new_comment_post_closed() {
    3248        $this->make_user_by_role( 'administrator' );
    33         $post = self::factory()->post->create_and_get( array(
    34             'comment_status' => 'closed'
    35         ) );
     49        $post = self::factory()->post->create_and_get(
     50            array(
     51                'comment_status' => 'closed',
     52            )
     53        );
    3654
    3755        $this->assertEquals( 'closed', $post->comment_status );
    3856
    39         $result = $this->myxmlrpcserver->wp_newComment( array( 1, 'administrator', 'administrator', $post->ID, array(
    40             'content' => rand_str( 100 ),
    41         ) ) );
     57        $result = $this->myxmlrpcserver->wp_newComment(
     58            array(
     59                1,
     60                'administrator',
     61                'administrator',
     62                $post->ID,
     63                array(
     64                    'content' => rand_str( 100 ),
     65                ),
     66            )
     67        );
    4268
    4369        $this->assertIXRError( $result );
     
    4975        $post = self::factory()->post->create_and_get();
    5076
    51         $comment_args = array( 1, 'administrator', 'administrator', $post->ID, array(
    52             'content' => rand_str( 100 ),
    53         ) );
     77        $comment_args = array(
     78            1,
     79            'administrator',
     80            'administrator',
     81            $post->ID,
     82            array(
     83                'content' => rand_str( 100 ),
     84            ),
     85        );
    5486
    5587        // First time it's a valid comment
    56         $result = $this->myxmlrpcserver->wp_newComment( $comment_args  );
     88        $result = $this->myxmlrpcserver->wp_newComment( $comment_args );
    5789        $this->assertNotIXRError( $result );
    5890
Note: See TracChangeset for help on using the changeset viewer.