Changeset 7797
- Timestamp:
- 10/04/2026 09:07:33 AM (5 weeks ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/testcases/admin/tools.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/admin/tools.php
r7796 r7797 901 901 /** 902 902 * @covers ::bbp_admin_repair_user_roles 903 * @todo Implement test_bbp_admin_repair_user_roles().904 903 */ 905 904 public function test_bbp_admin_repair_user_roles() { 906 // Remove the following lines when you implement this test. 907 $this->markTestIncomplete( 908 'This test has not been implemented yet.' 909 ); 905 $user_id = $this->factory->user->create( array( 'role' => 'subscriber' ) ); 906 bbp_set_user_role( $user_id, bbp_get_blocked_role() ); 907 908 $this->assertSame( 0, bbp_admin_repair_user_roles()[0] ); 909 $this->assertSame( bbp_get_default_role(), bbp_get_user_role( $user_id ) ); 910 910 } 911 911 912 912 /** 913 913 * @covers ::bbp_admin_repair_freshness 914 * @todo Implement test_bbp_admin_repair_freshness().915 914 */ 916 915 public function test_bbp_admin_repair_freshness() { 917 // Remove the following lines when you implement this test. 918 $this->markTestIncomplete( 919 'This test has not been implemented yet.' 920 ); 916 $forum_id = $this->factory->forum->create(); 917 $topic_id = $this->factory->topic->create( array( 'post_parent' => $forum_id ) ); 918 $reply_id = $this->factory->reply->create( array( 'post_parent' => $topic_id ) ); 919 update_post_meta( $topic_id, '_bbp_last_reply_id', 999 ); 920 update_post_meta( $forum_id, '_bbp_last_topic_id', 999 ); 921 922 $this->assertSame( 0, bbp_admin_repair_freshness()[0] ); 923 $this->assertSame( (string) $reply_id, get_post_meta( $topic_id, '_bbp_last_reply_id', true ) ); 924 $this->assertSame( (string) $topic_id, get_post_meta( $forum_id, '_bbp_last_topic_id', true ) ); 921 925 } 922 926 … … 952 956 /** 953 957 * @covers ::bbp_admin_repair_forum_visibility 954 * @todo Implement test_bbp_admin_repair_forum_visibility().955 958 */ 956 959 public function test_bbp_admin_repair_forum_visibility() { 957 // Remove the following lines when you implement this test. 958 $this->markTestIncomplete( 959 'This test has not been implemented yet.' 960 ); 960 $private_id = $this->factory->forum->create( array( 'post_status' => bbp_get_private_status_id() ) ); 961 $hidden_id = $this->factory->forum->create( array( 'post_status' => bbp_get_hidden_status_id() ) ); 962 update_option( '_bbp_private_forums', array() ); 963 update_option( '_bbp_hidden_forums', array() ); 964 965 $this->assertSame( 0, bbp_admin_repair_forum_visibility()[0] ); 966 $this->assertContains( $private_id, get_option( '_bbp_private_forums' ) ); 967 $this->assertContains( $hidden_id, get_option( '_bbp_hidden_forums' ) ); 961 968 } 962 969
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)