[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

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

   1  <?php
   2  
   3  /**
   4   * Tests for the `bbp_*_form_reply_post_type_*()` functions.
   5   *
   6   * @group replies
   7   * @group template
   8   * @group post_type
   9   */
  10  class BBP_Tests_Replies_Template_Post_Type extends BBP_UnitTestCase {
  11  
  12      /**
  13       * @covers ::bbp_reply_post_type
  14       * @covers ::bbp_get_reply_post_type
  15       */
  16  	public function test_bbp_reply_post_type() {
  17          $t = $this->factory->topic->create();
  18  
  19          $r = $this->factory->reply->create( array(
  20              'post_parent' => $t,
  21              'reply_meta' => array(
  22                  'topic_id' => $t,
  23              ),
  24          ) );
  25  
  26          $robj = get_post_type_object( 'reply' );
  27  
  28          // WordPress 4.6 introduced `WP_Post_Type` class
  29          if ( bbp_get_major_wp_version() < 4.6 ) {
  30              $this->assertInstanceOf( 'stdClass', $robj );
  31          } else {
  32              $this->assertInstanceOf( 'WP_Post_Type', $robj );
  33          }
  34  
  35          $this->assertEquals( 'reply', $robj->name );
  36  
  37          // Test some defaults
  38          $this->assertFalse( is_post_type_hierarchical( 'topic' ) );
  39          $reply_type = bbp_reply_post_type( $r );
  40          $this->expectOutputString( 'reply', $reply_type );
  41  
  42          $reply_type = bbp_get_reply_post_type( $r );
  43          $this->assertSame( 'reply', $reply_type );
  44      }
  45  
  46      /**
  47       * @covers ::bbp_get_reply_post_type_labels
  48       * @todo   Implement test_bbp_get_reply_post_type_labels().
  49       */
  50  	public function test_bbp_get_reply_post_type_labels() {
  51          // Remove the following lines when you implement this test.
  52          $this->markTestIncomplete(
  53              'This test has not been implemented yet.'
  54          );
  55      }
  56  
  57      /**
  58       * @covers ::bbp_get_reply_post_type_rewrite
  59       * @todo   Implement test_bbp_get_reply_post_type_rewrite().
  60       */
  61  	public function test_bbp_get_reply_post_type_rewrite() {
  62          // Remove the following lines when you implement this test.
  63          $this->markTestIncomplete(
  64              'This test has not been implemented yet.'
  65          );
  66      }
  67  
  68      /**
  69       * @covers ::bbp_get_reply_post_type_supports
  70       * @todo   Implement test_bbp_get_reply_post_type_supports().
  71       */
  72  	public function test_bbp_get_reply_post_type_supports() {
  73          // Remove the following lines when you implement this test.
  74          $this->markTestIncomplete(
  75              'This test has not been implemented yet.'
  76          );
  77      }
  78  }


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