- Timestamp:
- 02/17/2022 08:04:32 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/tests/phpunit/testcases/topics/functions/topic.php
r6330 r7234 424 424 /** 425 425 * @covers ::bbp_untrash_topic 426 * @todo Implement test_bbp_untrash_topic().427 426 */ 428 427 public function test_bbp_untrash_topic() { 429 // Remove the following lines when you implement this test. 430 $this->markTestIncomplete( 431 'This test has not been implemented yet.' 432 ); 428 $f = $this->factory->forum->create(); 429 $t = $this->factory->topic->create( array( 430 'post_parent' => $f, 431 'topic_meta' => array( 432 'forum_id' => $f, 433 ), 434 ) ); 435 436 wp_trash_post( $t ); 437 438 wp_untrash_post( $t ); 439 440 $this->assertTrue( 'publish' === get_post_status( $t ) ); 433 441 } 434 442 435 443 /** 436 444 * @covers ::bbp_untrash_topic_replies 437 * @todo Implement test_bbp_untrash_topic_replies().438 445 */ 439 446 public function test_bbp_untrash_topic_replies() { 440 // Remove the following lines when you implement this test. 441 $this->markTestIncomplete( 442 'This test has not been implemented yet.' 443 ); 447 $f = $this->factory->forum->create(); 448 $t = $this->factory->topic->create( array( 449 'post_parent' => $f, 450 'topic_meta' => array( 451 'forum_id' => $f, 452 ), 453 ) ); 454 $r = $this->factory->reply->create_many( 2, array( 455 'post_parent' => $t, 456 'reply_meta' => array( 457 'forum_id' => $f, 458 'topic_id' => $t, 459 ), 460 ) ); 461 462 wp_trash_post( $t ); 463 464 wp_untrash_post( $t ); 465 466 $expected = []; 467 $expected[] = get_post_status( $r[0] ); 468 $expected[] = get_post_status( $r[1] ); 469 470 $this->assertSame( [ 'publish', 'publish' ], $expected ); 444 471 } 445 472
Note: See TracChangeset
for help on using the changeset viewer.