Changeset 7802
- Timestamp:
- 10/04/2026 09:26:15 AM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/topics/functions/topic.php
r7801 r7802 108 108 /** 109 109 * @covers ::bbp_update_topic 110 * @todo Implement test_bbp_update_topic().111 110 */ 112 111 public function test_bbp_update_topic() { 113 // Remove the following lines when you implement this test. 114 $this->markTestIncomplete( 115 'This test has not been implemented yet.' 116 ); 112 $old_user = get_current_user_id(); 113 $user_id = $this->factory->user->create(); 114 $forum_id = $this->factory->forum->create(); 115 $topic_id = $this->factory->topic->create( array( 'post_parent' => $forum_id, 'post_author' => $user_id ) ); 116 update_post_meta( $topic_id, '_edit_lock', 'stale' ); 117 delete_post_meta( $topic_id, '_bbp_forum_id' ); 118 delete_post_meta( $topic_id, '_bbp_topic_id' ); 119 $this->set_current_user( $user_id ); 120 121 try { 122 bbp_update_topic( $topic_id, $forum_id, array(), $user_id, true ); 123 $this->assertSame( (string) $user_id, get_post_meta( $topic_id, '_edit_last', true ) ); 124 $this->assertFalse( metadata_exists( 'post', $topic_id, '_edit_lock' ) ); 125 $this->assertSame( (string) $forum_id, get_post_meta( $topic_id, '_bbp_forum_id', true ) ); 126 $this->assertSame( (string) $topic_id, get_post_meta( $topic_id, '_bbp_topic_id', true ) ); 127 delete_post_meta( $topic_id, '_bbp_last_active_id' ); 128 delete_post_meta( $topic_id, '_bbp_reply_count' ); 129 bbp_update_topic( $topic_id, $forum_id, array(), $user_id, false ); 130 $this->assertSame( (string) $topic_id, get_post_meta( $topic_id, '_bbp_last_active_id', true ) ); 131 $this->assertSame( '0', get_post_meta( $topic_id, '_bbp_reply_count', true ) ); 132 } finally { 133 $this->set_current_user( $old_user ); 134 } 117 135 } 118 136
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)