[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

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

   1  <?php
   2  
   3  /**
   4   * Tests for the `bbp_*_form_forum_*` visibility template functions.
   5   *
   6   * @group forums
   7   * @group template
   8   * @group visibility
   9   */
  10  class BBP_Tests_Forums_Template_Visibility extends BBP_UnitTestCase {
  11  
  12      /**
  13       * @covers ::bbp_forum_visibility
  14       * @covers ::bbp_get_forum_visibility
  15       */
  16  	public function test_bbp_get_forum_visibility() {
  17          $f = $this->factory->forum->create();
  18  
  19          $forum = bbp_get_forum_visibility( $f, bbp_get_public_status_id(), false );
  20          $this->assertSame( 'publish', $forum );
  21  
  22          $f = $this->factory->forum->create( array(
  23              'post_status' => bbp_get_private_status_id()
  24          ) );
  25  
  26          //bbp_privatize_forum( $f );
  27          $forum = bbp_get_forum_visibility( $f, bbp_get_private_status_id(), false );
  28          $this->assertSame( 'private', $forum );
  29  
  30          $f = $this->factory->forum->create();
  31  
  32          bbp_hide_forum( $f );
  33          $forum = bbp_get_forum_visibility( $f, bbp_get_hidden_status_id(), false );
  34          $this->assertSame( 'hidden', $forum );
  35      }
  36  
  37      /**
  38       * @covers ::bbp_is_forum_visibility
  39       */
  40  	public function test_bbp_is_forum_visibility() {
  41          $f = $this->factory->forum->create();
  42  
  43          $forum = bbp_is_forum_visibility( $f, bbp_get_public_status_id(), false );
  44          $this->assertTrue( $forum );
  45  
  46          $f = $this->factory->forum->create( array(
  47              'post_status' => bbp_get_private_status_id()
  48          ) );
  49  
  50          $forum = bbp_is_forum_visibility( $f, bbp_get_private_status_id(), false );
  51          $this->assertTrue( $forum );
  52  
  53          $f = $this->factory->forum->create();
  54  
  55          bbp_hide_forum( $f );
  56          $forum = bbp_is_forum_visibility( $f, bbp_get_hidden_status_id(), false );
  57          $this->assertTrue( $forum );
  58      }
  59  
  60      /**
  61       * @covers ::bbp_suppress_private_forum_meta
  62       * @todo   Implement test_bbp_suppress_private_forum_meta().
  63       */
  64  	public function test_bbp_suppress_private_forum_meta() {
  65          // Remove the following lines when you implement this test.
  66          $this->markTestIncomplete(
  67              'This test has not been implemented yet.'
  68          );
  69      }
  70  
  71      /**
  72       * @covers ::bbp_suppress_private_author_link
  73       * @todo   Implement test_bbp_suppress_private_author_link().
  74       */
  75  	public function test_bbp_suppress_private_author_link() {
  76          // Remove the following lines when you implement this test.
  77          $this->markTestIncomplete(
  78              'This test has not been implemented yet.'
  79          );
  80      }
  81  }


Generated: Sat Dec 21 01:00:52 2024 Cross-referenced by PHPXref 0.7.1