Changeset 7804
- Timestamp:
- 10/04/2026 09:34:34 AM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/replies/functions/reply.php
r7803 r7804 580 580 /** 581 581 * @covers ::bbp_list_replies 582 * @todo Implement test_bbp_list_replies().583 582 */ 584 583 public function test_bbp_list_replies() { 585 // Remove the following lines when you implement this test. 586 $this->markTestIncomplete( 587 'This test has not been implemented yet.' 588 ); 584 $bbp = bbpress(); 585 $old_query = $bbp->reply_query; 586 $old_pages = $bbp->max_num_pages; 587 $walker = new class { 588 public $max_pages = 2; 589 590 public function paged_walk() { 591 return '<li>Reply</li>'; 592 } 593 }; 594 $bbp->reply_query = (object) array( 'posts' => array() ); 595 596 try { 597 ob_start(); 598 bbp_list_replies( array( 'walker' => $walker, 'style' => 'div' ) ); 599 $this->assertSame( "<div class='bbp-replies-list'><li>Reply</li></div>", ob_get_clean() ); 600 $this->assertSame( 2, $bbp->max_num_pages ); 601 $this->assertFalse( $bbp->reply_query->in_the_loop ); 602 ob_start(); 603 bbp_list_replies( array( 'walker' => $walker, 'style' => 'table' ) ); 604 $this->assertSame( "<ul class='bbp-replies-list'><li>Reply</li></ul>", ob_get_clean() ); 605 } finally { 606 $bbp->reply_query = $old_query; 607 $bbp->max_num_pages = $old_pages; 608 } 589 609 } 590 610
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)