[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/tests/phpunit/testcases/forums/template/ -> feeds.php (source)

   1  <?php
   2  
   3  /**
   4   * Tests for the `bbp_*_form_forum_*_feed_link()` functions.
   5   *
   6   * @group forums
   7   * @group template
   8   * @group feeds
   9   */
  10  class BBP_Tests_Forums_Template_Feeds extends BBP_UnitTestCase {
  11  
  12      /**
  13       * @covers ::bbp_forum_topics_feed_link
  14       * @covers ::bbp_get_forum_topics_feed_link
  15       */
  16  	public function test_bbp_get_forum_topics_feed_link() {
  17  
  18          if ( is_multisite() ) {
  19              $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
  20          }
  21  
  22          $f = $this->factory->forum->create( array(
  23              'post_title' => 'Forum 1',
  24          ) );
  25  
  26          $feed_link = bbp_get_forum_topics_feed_link( $f );
  27          $this->expectOutputString( $feed_link );
  28          bbp_forum_topics_feed_link( $f );
  29  
  30          $feed_link = bbp_get_forum_topics_feed_link( $f );
  31          $this->assertSame( '<a href="http://' . WP_TESTS_DOMAIN . '/?feed=rss2&#038;forum=forum-1" class="bbp-forum-rss-link topics"><span>Topics</span></a>', $feed_link );
  32      }
  33  
  34      /**
  35       * @covers ::bbp_forum_replies_feed_link
  36       * @covers ::bbp_get_forum_replies_feed_link
  37       */
  38  	public function test_bbp_get_forum_replies_feed_link() {
  39  
  40          if ( is_multisite() ) {
  41              $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
  42          }
  43  
  44          $f = $this->factory->forum->create( array(
  45              'post_title' => 'Forum 1',
  46          ) );
  47  
  48          $feed_link = bbp_get_forum_replies_feed_link( $f );
  49          $this->expectOutputString( $feed_link );
  50          bbp_forum_replies_feed_link( $f );
  51  
  52          $feed_link = bbp_get_forum_replies_feed_link( $f );
  53          $this->assertSame( '<a href="http://' . WP_TESTS_DOMAIN . '/?type=reply&#038;feed=rss2&#038;forum=forum-1" class="bbp-forum-rss-link replies"><span>Replies</span></a>', $feed_link );
  54      }
  55  }


Generated: Fri Jul 10 01:01:27 2020 Cross-referenced by PHPXref 0.7.1