/**
  * @covers ::bbp_forum_last_topic_author_link
  * @covers ::bbp_get_forum_last_topic_author_link	 */
 public function test_bbp_get_forum_last_topic_author_link()
 {
     if (is_multisite()) {
         $this->markTestSkipped('Skipping URL tests in multisite for now.');
     }
     $u = $this->factory->user->create();
     $c = $this->factory->forum->create(array('forum_meta' => array('forum_type' => 'category', 'status' => 'open')));
     $f = $this->factory->forum->create(array('post_parent' => $c, 'forum_meta' => array('forum_id' => $c, 'forum_type' => 'forum', 'status' => 'open')));
     $t = $this->factory->topic->create(array('post_parent' => $f, 'post_author' => $u, 'topic_meta' => array('forum_id' => $f)));
     // Get the forums last topic author link.
     $last_topic_author_link = bbp_get_forum_last_topic_author_link($f);
     $this->assertSame(bbp_get_user_profile_link($u), $last_topic_author_link);
     // Get the categories last topic author link.
     $last_topic_author_link = bbp_get_forum_last_topic_author_link($c);
     $this->assertSame(bbp_get_user_profile_link($u), $last_topic_author_link);
 }
Example #2
0
/**
 * Output link to author of last topic of forum
 *
 * @since bbPress (r2625)
 *
 * @param int $forum_id Optional. Forum id
 * @uses bbp_get_forum_last_topic_author_link() To get the forum's last topic's
 *                                               author link
 */
function bbp_forum_last_topic_author_link($forum_id = 0)
{
    echo bbp_get_forum_last_topic_author_link($forum_id);
}