[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/tests/phpunit/testcases/topics/template/ -> post_type.php (source)

   1  <?php
   2  
   3  /**
   4   * Tests for the `bbp_*_form_topic_post_type_*()` functions.
   5   *
   6   * @group topics
   7   * @group template
   8   * @group post_type
   9   */
  10  class BBP_Tests_Topics_Template_Post_Type extends BBP_UnitTestCase {
  11  
  12      /**
  13       * @covers ::bbp_topic_post_type
  14       * @covers ::bbp_get_topic_post_type
  15       */
  16  	public function test_bbp_topic_post_type() {
  17          $t = $this->factory->topic->create();
  18  
  19          $tobj = get_post_type_object( 'topic' );
  20  
  21          // WordPress 4.6 introduced `WP_Post_Type` class
  22          if ( bbp_get_major_wp_version() < 4.6 ) {
  23              $this->assertInstanceOf( 'stdClass', $tobj );
  24          } else {
  25              $this->assertInstanceOf( 'WP_Post_Type', $tobj );
  26          }
  27  
  28          $this->assertEquals( 'topic', $tobj->name );
  29  
  30          // Test some defaults
  31          $this->assertFalse( is_post_type_hierarchical( 'topic' ) );
  32  
  33          $topic_type = bbp_topic_post_type( $t );
  34          $this->expectOutputString( 'topic', $topic_type );
  35  
  36          $topic_type = bbp_get_topic_post_type( $t );
  37          $this->assertSame( 'topic', $topic_type );
  38      }
  39  
  40      /**
  41       * @covers ::bbp_get_topic_post_type_labels
  42       * @todo   Implement test_bbp_get_topic_post_type_labels().
  43       */
  44  	public function test_bbp_get_topic_post_type_labels() {
  45          // Remove the following lines when you implement this test.
  46          $this->markTestIncomplete(
  47              'This test has not been implemented yet.'
  48          );
  49      }
  50  
  51      /**
  52       * @covers ::bbp_get_topic_post_type_rewrite
  53       * @todo   Implement test_bbp_get_topic_post_type_rewrite().
  54       */
  55  	public function test_bbp_get_topic_post_type_rewrite() {
  56          // Remove the following lines when you implement this test.
  57          $this->markTestIncomplete(
  58              'This test has not been implemented yet.'
  59          );
  60      }
  61  
  62      /**
  63       * @covers ::bbp_get_topic_post_type_supports
  64       * @todo   Implement test_bbp_get_topic_post_type_supports().
  65       */
  66  	public function test_bbp_get_topic_post_type_supports() {
  67          // Remove the following lines when you implement this test.
  68          $this->markTestIncomplete(
  69              'This test has not been implemented yet.'
  70          );
  71      }
  72  }


Generated: Mon Dec 30 01:00:53 2024 Cross-referenced by PHPXref 0.7.1