Changeset 42343 for trunk/tests/phpunit/tests/comment/walker.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/walker.php
r35242 r42343 17 17 function test_has_children() { 18 18 $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 ); 20 25 $comment_parent = get_comment( $comment_parent ); 21 $comment_child = get_comment( $comment_child 26 $comment_child = get_comment( $comment_child ); 22 27 23 28 $comment_walker = new Walker_Comment(); 24 29 $comment_callback = new Comment_Callback_Test( $this, $comment_walker ); 25 30 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 ); 28 45 } 29 46 } … … 38 55 if ( 1 == $depth ) { 39 56 $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 ) { 44 59 $this->test_walker->assertFalse( $this->walker->has_children ); 45 $this->test_walker->assertFalse( $args['has_children'] 60 $this->test_walker->assertFalse( $args['has_children'] ); // Back compat 46 61 } 47 62 }
Note: See TracChangeset
for help on using the changeset viewer.