/** * @covers ::bbp_get_user_favorites */ public function test_bbp_get_user_favorites() { $u = $this->factory->user->create(); $t = $this->factory->topic->create_many(3); // Add topic favorites. bbp_add_user_favorite($u, $t[0]); bbp_add_user_favorite($u, $t[1]); bbp_add_user_favorite($u, $t[2]); $expected = bbp_has_topics(array('post__in' => array($t[0], $t[1], $t[2]))); $favorites = bbp_get_user_favorites($u); $this->assertEquals($expected, $favorites); // Remove user favorite. bbp_remove_user_favorite($u, $t[1]); $expected = bbp_has_topics(array('post__in' => array($t[0], $t[2]))); $favorites = bbp_get_user_favorites($u); $this->assertEquals($expected, $favorites); }
*/ ?> <?php do_action('bbp_template_before_user_favorites'); ?> <div id="bbp-user-favorites" class="bbp-user-favorites"> <h2 class="entry-title"><?php _e('Favorite Forum Topics', 'bbpress'); ?> </h2> <div class="bbp-user-section"> <?php if (bbp_get_user_favorites()) { ?> <?php bbp_get_template_part('pagination', 'topics'); ?> <?php bbp_get_template_part('loop', 'topics'); ?> <?php bbp_get_template_part('pagination', 'topics'); ?> <?php