Changeset 7780
- Timestamp:
- 10/04/2026 07:36:22 AM (5 weeks ago)
- Location:
- trunk/tests/phpunit/testcases
- Files:
-
- 4 edited
-
replies/template/loop.php (modified) (1 diff)
-
replies/template/post_type.php (modified) (1 diff)
-
topics/template/loop.php (modified) (1 diff)
-
topics/template/post_type.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/replies/template/loop.php
r5725 r7780 12 12 /** 13 13 * @covers ::bbp_has_replies 14 * @todo Implement test_bbp_has_replies().15 14 */ 16 15 public function test_bbp_has_replies() { 17 // Remove the following lines when you implement this test. 18 $this->markTestIncomplete( 19 'This test has not been implemented yet.' 20 ); 16 $topic_id = $this->factory->topic->create(); 17 $reply_id = $this->factory->reply->create( array( 'post_parent' => $topic_id ) ); 18 19 $this->assertTrue( bbp_has_replies( array( 20 'post_type' => bbp_get_reply_post_type(), 21 'post_parent' => $topic_id, 22 ) ) ); 23 $this->assertSame( 1, bbpress()->reply_query->post_count ); 24 $this->assertSame( $reply_id, bbpress()->reply_query->posts[0]->ID ); 25 $this->assertFalse( bbp_has_replies( array( 26 'post_type' => bbp_get_reply_post_type(), 27 'post_parent' => $reply_id, 28 ) ) ); 21 29 } 22 30 23 31 /** 24 32 * @covers ::bbp_replies 25 * @todo Implement test_bbp_replies().26 33 */ 27 34 public function test_bbp_replies() { 28 // Remove the following lines when you implement this test. 29 $this->markTestIncomplete( 30 'This test has not been implemented yet.' 31 ); 35 $topic_id = $this->factory->topic->create(); 36 $this->factory->reply->create( array( 'post_parent' => $topic_id ) ); 37 bbp_has_replies( array( 38 'post_type' => bbp_get_reply_post_type(), 39 'post_parent' => $topic_id, 40 ) ); 41 42 $this->assertTrue( bbp_replies() ); 43 bbp_the_reply(); 44 $this->assertFalse( bbp_replies() ); 32 45 } 33 46 34 47 /** 35 48 * @covers ::bbp_the_reply 36 * @todo Implement test_bbp_the_reply().37 49 */ 38 50 public function test_bbp_the_reply() { 39 // Remove the following lines when you implement this test. 40 $this->markTestIncomplete( 41 'This test has not been implemented yet.' 42 ); 51 $topic_id = $this->factory->topic->create(); 52 $reply_id = $this->factory->reply->create( array( 'post_parent' => $topic_id ) ); 53 bbp_has_replies( array( 54 'post_type' => bbp_get_reply_post_type(), 55 'post_parent' => $topic_id, 56 ) ); 57 58 $this->assertTrue( bbp_replies() ); 59 bbp_the_reply(); 60 $this->assertSame( $reply_id, get_the_ID() ); 61 $this->assertFalse( bbp_replies() ); 43 62 } 44 63 } -
trunk/tests/phpunit/testcases/replies/template/post_type.php
r6071 r7780 46 46 /** 47 47 * @covers ::bbp_get_reply_post_type_labels 48 * @todo Implement test_bbp_get_reply_post_type_labels().49 48 */ 50 49 public function test_bbp_get_reply_post_type_labels() { 51 // Remove the following lines when you implement this test. 52 $this->markTestIncomplete( 53 'This test has not been implemented yet.' 54 ); 50 $labels = bbp_get_reply_post_type_labels(); 51 52 $this->assertSame( 'Replies', $labels['name'] ); 53 $this->assertSame( 'Reply', $labels['singular_name'] ); 54 $this->assertSame( 'Add Reply', $labels['add_new_item'] ); 55 $this->assertSame( 'Parent Topic:', $labels['parent_item_colon'] ); 56 $this->assertSame( 'Reply updated.', $labels['item_updated'] ); 55 57 } 56 58 57 59 /** 58 60 * @covers ::bbp_get_reply_post_type_rewrite 59 * @todo Implement test_bbp_get_reply_post_type_rewrite().60 61 */ 61 62 public function test_bbp_get_reply_post_type_rewrite() { 62 // Remove the following lines when you implement this test.63 $this->markTestIncomplete(64 ' This test has not been implemented yet.'65 ) ;63 $this->assertSame( array( 64 'slug' => bbp_get_reply_slug(), 65 'with_front' => false, 66 ), bbp_get_reply_post_type_rewrite() ); 66 67 } 67 68 68 69 /** 69 70 * @covers ::bbp_get_reply_post_type_supports 70 * @todo Implement test_bbp_get_reply_post_type_supports().71 71 */ 72 72 public function test_bbp_get_reply_post_type_supports() { 73 // Remove the following lines when you implement this test. 74 $this->markTestIncomplete( 75 'This test has not been implemented yet.' 76 ); 73 $this->assertSame( array( 'title', 'editor', 'revisions' ), bbp_get_reply_post_type_supports() ); 77 74 } 78 75 } -
trunk/tests/phpunit/testcases/topics/template/loop.php
r5725 r7780 12 12 /** 13 13 * @covers ::bbp_has_topics 14 * @todo Implement test_bbp_has_topics().15 14 */ 16 15 public function test_bbp_has_topics() { 17 // Remove the following lines when you implement this test. 18 $this->markTestIncomplete( 19 'This test has not been implemented yet.' 20 ); 16 $forum_id = $this->factory->forum->create(); 17 $topic_id = $this->factory->topic->create( array( 'post_parent' => $forum_id ) ); 18 19 $this->assertTrue( bbp_has_topics( array( 20 'post_parent' => $forum_id, 21 'posts_per_page' => -1, 22 ) ) ); 23 $this->assertSame( 1, bbpress()->topic_query->post_count ); 24 $this->assertSame( $topic_id, bbpress()->topic_query->posts[0]->ID ); 25 $this->assertFalse( bbp_has_topics( array( 'post_parent' => $topic_id ) ) ); 21 26 } 22 27 23 28 /** 24 29 * @covers ::bbp_topics 25 * @todo Implement test_bbp_topics().26 30 */ 27 31 public function test_bbp_topics() { 28 // Remove the following lines when you implement this test. 29 $this->markTestIncomplete( 30 'This test has not been implemented yet.' 31 ); 32 $forum_id = $this->factory->forum->create(); 33 $this->factory->topic->create( array( 'post_parent' => $forum_id ) ); 34 bbp_has_topics( array( 'post_parent' => $forum_id ) ); 35 36 $this->assertTrue( bbp_topics() ); 37 bbp_the_topic(); 38 $this->assertFalse( bbp_topics() ); 32 39 } 33 40 34 41 /** 35 42 * @covers ::bbp_the_topic 36 * @todo Implement test_bbp_the_topic().37 43 */ 38 44 public function test_bbp_the_topic() { 39 // Remove the following lines when you implement this test. 40 $this->markTestIncomplete( 41 'This test has not been implemented yet.' 42 ); 45 $forum_id = $this->factory->forum->create(); 46 $topic_id = $this->factory->topic->create( array( 'post_parent' => $forum_id ) ); 47 bbp_has_topics( array( 'post_parent' => $forum_id ) ); 48 49 $this->assertTrue( bbp_topics() ); 50 bbp_the_topic(); 51 $this->assertSame( $topic_id, get_the_ID() ); 52 $this->assertFalse( bbp_topics() ); 43 53 } 44 54 } -
trunk/tests/phpunit/testcases/topics/template/post_type.php
r6071 r7780 40 40 /** 41 41 * @covers ::bbp_get_topic_post_type_labels 42 * @todo Implement test_bbp_get_topic_post_type_labels().43 42 */ 44 43 public function test_bbp_get_topic_post_type_labels() { 45 // Remove the following lines when you implement this test. 46 $this->markTestIncomplete( 47 'This test has not been implemented yet.' 48 ); 44 $labels = bbp_get_topic_post_type_labels(); 45 46 $this->assertSame( 'Topics', $labels['name'] ); 47 $this->assertSame( 'Topic', $labels['singular_name'] ); 48 $this->assertSame( 'Add Topic', $labels['add_new_item'] ); 49 $this->assertSame( 'Forum:', $labels['parent_item_colon'] ); 50 $this->assertSame( 'Topic updated.', $labels['item_updated'] ); 49 51 } 50 52 51 53 /** 52 54 * @covers ::bbp_get_topic_post_type_rewrite 53 * @todo Implement test_bbp_get_topic_post_type_rewrite().54 55 */ 55 56 public function test_bbp_get_topic_post_type_rewrite() { 56 // Remove the following lines when you implement this test.57 $this->markTestIncomplete(58 ' This test has not been implemented yet.'59 ) ;57 $this->assertSame( array( 58 'slug' => bbp_get_topic_slug(), 59 'with_front' => false, 60 ), bbp_get_topic_post_type_rewrite() ); 60 61 } 61 62 62 63 /** 63 64 * @covers ::bbp_get_topic_post_type_supports 64 * @todo Implement test_bbp_get_topic_post_type_supports().65 65 */ 66 66 public function test_bbp_get_topic_post_type_supports() { 67 // Remove the following lines when you implement this test. 68 $this->markTestIncomplete( 69 'This test has not been implemented yet.' 70 ); 67 $this->assertSame( array( 'title', 'editor', 'revisions' ), bbp_get_topic_post_type_supports() ); 71 68 } 72 69 }
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)