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/walker.php

    r35242 r42343  
    1717    function test_has_children() {
    1818        $comment_parent = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id ) );
    19         $comment_child  = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_parent' => $comment_parent ) );
     19        $comment_child  = self::factory()->comment->create(
     20            array(
     21                'comment_post_ID' => $this->post_id,
     22                'comment_parent'  => $comment_parent,
     23            )
     24        );
    2025        $comment_parent = get_comment( $comment_parent );
    21         $comment_child  = get_comment( $comment_child  );
     26        $comment_child  = get_comment( $comment_child );
    2227
    2328        $comment_walker   = new Walker_Comment();
    2429        $comment_callback = new Comment_Callback_Test( $this, $comment_walker );
    2530
    26         wp_list_comments( array( 'callback' => array( $comment_callback, 'comment' ), 'walker' => $comment_walker, 'echo' => false ), array( $comment_parent, $comment_child ) );
    27         wp_list_comments( array( 'callback' => array( $comment_callback, 'comment' ), 'walker' => $comment_walker, 'echo' => false ), array( $comment_child, $comment_parent ) );
     31        wp_list_comments(
     32            array(
     33                'callback' => array( $comment_callback, 'comment' ),
     34                'walker'   => $comment_walker,
     35                'echo'     => false,
     36            ), array( $comment_parent, $comment_child )
     37        );
     38        wp_list_comments(
     39            array(
     40                'callback' => array( $comment_callback, 'comment' ),
     41                'walker'   => $comment_walker,
     42                'echo'     => false,
     43            ), array( $comment_child, $comment_parent )
     44        );
    2845    }
    2946}
     
    3855        if ( 1 == $depth ) {
    3956            $this->test_walker->assertTrue( $this->walker->has_children );
    40             $this->test_walker->assertTrue( $args['has_children']       ); // Back compat
    41         }
    42 
    43         else if ( 2 == $depth ) {
     57            $this->test_walker->assertTrue( $args['has_children'] ); // Back compat
     58        } elseif ( 2 == $depth ) {
    4459            $this->test_walker->assertFalse( $this->walker->has_children );
    45             $this->test_walker->assertFalse( $args['has_children']       ); // Back compat
     60            $this->test_walker->assertFalse( $args['has_children'] ); // Back compat
    4661        }
    4762    }
Note: See TracChangeset for help on using the changeset viewer.