Skip to:
Content

bbPress.org

Changeset 6071


Ignore:
Timestamp:
08/12/2016 06:23:47 AM (9 years ago)
Author:
netweb
Message:

Tests: Update forum/topic/reply post type assertions for the WP_Post_Type class introduced in WordPress 4.6

Fixes #2962.

Location:
trunk/tests/phpunit/testcases
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/forums/template/post_type.php

    r5746 r6071  
    1818
    1919        $fobj = get_post_type_object( 'forum' );
    20         $this->assertInstanceOf( 'stdClass', $fobj );
     20
     21        // WordPress 4.6 introduced `WP_Post_Type` class
     22        if ( bbp_get_major_wp_version() < 4.6 ) {
     23            $this->assertInstanceOf( 'stdClass', $fobj );
     24        } else {
     25            $this->assertInstanceOf( 'WP_Post_Type', $fobj );
     26        }
     27
    2128        $this->assertEquals( 'forum', $fobj->name );
    2229
  • trunk/tests/phpunit/testcases/replies/template/post_type.php

    r5890 r6071  
    2525
    2626        $robj = get_post_type_object( 'reply' );
    27         $this->assertInstanceOf( 'stdClass', $robj );
     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
    2835        $this->assertEquals( 'reply', $robj->name );
    2936
  • trunk/tests/phpunit/testcases/topics/template/post_type.php

    r5746 r6071  
    1818
    1919        $tobj = get_post_type_object( 'topic' );
    20         $this->assertInstanceOf( 'stdClass', $tobj );
     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
    2128        $this->assertEquals( 'topic', $tobj->name );
    2229
Note: See TracChangeset for help on using the changeset viewer.