Exemplo n.º 1
0
 /**
  * @covers ::bbp_forum_last_reply_author_link
  * @covers ::bbp_get_forum_last_reply_author_link
  */
 public function test_bbp_get_forum_last_reply_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_author' => $u, '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)));
     $r = $this->factory->reply->create(array('post_parent' => $t, 'post_author' => $u, 'reply_meta' => array('forum_id' => $f, 'topic_id' => $t)));
     // Get the forums last reply author link.
     $last_reply_author_link = bbp_get_forum_last_reply_author_link($f);
     $this->assertSame(bbp_get_user_profile_link($u), $last_reply_author_link);
     // Get the categories last reply author link.
     $last_reply_author_link = bbp_get_forum_last_reply_author_link($c);
     $this->assertSame(bbp_get_user_profile_link($u), $last_reply_author_link);
 }
Exemplo n.º 2
0
/**
 * Output link to author of last reply of forum
 *
 * @since bbPress (r2625)
 *
 * @param int $forum_id Optional. Forum id
 * @uses bbp_get_forum_last_reply_author_link() To get the forum's last reply's
 *                                               author link
 */
function bbp_forum_last_reply_author_link($forum_id = 0)
{
    echo bbp_get_forum_last_reply_author_link($forum_id);
}