Changeset 34546 for trunk/tests/phpunit/tests/comment.php
- Timestamp:
- 09/25/2015 03:12:09 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment.php
r34533 r34546 289 289 $this->assertEquals( 'fire', get_comment_meta( $c, 'sauce', true ) ); 290 290 } 291 292 /** 293 * @ticket 8071 294 */ 295 public function test_wp_comment_get_children_should_fill_children() { 296 297 $p = $this->factory->post->create(); 298 299 $c1 = $this->factory->comment->create( array( 300 'comment_post_ID' => $p, 301 'comment_approved' => '1', 302 ) ); 303 304 $c2 = $this->factory->comment->create( array( 305 'comment_post_ID' => $p, 306 'comment_approved' => '1', 307 'comment_parent' => $c1, 308 ) ); 309 310 $c3 = $this->factory->comment->create( array( 311 'comment_post_ID' => $p, 312 'comment_approved' => '1', 313 'comment_parent' => $c2, 314 ) ); 315 316 $c4 = $this->factory->comment->create( array( 317 'comment_post_ID' => $p, 318 'comment_approved' => '1', 319 'comment_parent' => $c1, 320 ) ); 321 322 $c5 = $this->factory->comment->create( array( 323 'comment_post_ID' => $p, 324 'comment_approved' => '1', 325 ) ); 326 327 $c6 = $this->factory->comment->create( array( 328 'comment_post_ID' => $p, 329 'comment_approved' => '1', 330 'comment_parent' => $c5, 331 ) ); 332 333 $comment = get_comment( $c1 ); 334 $children = $comment->get_children(); 335 336 // Direct descendants of $c1. 337 $this->assertEquals( array( $c2, $c4 ), array_values( wp_list_pluck( $children, 'comment_ID' ) ) ); 338 339 // Direct descendants of $c2. 340 $this->assertEquals( array( $c3 ), array_values( wp_list_pluck( $children[ $c2 ]->get_children(), 'comment_ID' ) ) ); 341 } 291 342 }
Note: See TracChangeset
for help on using the changeset viewer.