Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/24/2015 09:55:26 AM (9 years ago)
Author:
netweb
Message:

Tests: Ensure bbPress' custom post types posts are created with a unique GUID.

Props tharsheblows, netweb. Fixes #2844, see also #WP5305 / wp:changeset:33630.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/forums/functions/forum.php

    r5863 r5925  
    1919
    2020        $now = time();
    21         $post_date = date( 'Y-m-d H:i:s', $now - 60*60*100 );
     21        $post_date = date( 'Y-m-d H:i:s', $now - 60 * 60 * 100 );
    2222
    2323        $t = $this->factory->topic->create( array(
     
    3838        ) );
    3939
    40         // Forum post
     40        // Get the forum.
     41        $forum = bbp_get_forum( $f );
     42
     43        // Forum post.
    4144        $this->assertSame( 'Forum 1', bbp_get_forum_title( $f ) );
    4245        $this->assertSame( 'Content of Forum 1', bbp_get_forum_content( $f ) );
     
    4548        $this->assertTrue( bbp_is_forum_public( $f ) );
    4649        $this->assertSame( 0, bbp_get_forum_parent_id( $f ) );
    47 
    48         // Forum meta
     50        $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/?forum=' . $forum->post_name, $forum->guid );
     51
     52        // Forum meta.
    4953        $this->assertSame( 0, bbp_get_forum_subforum_count( $f, true ) );
    50         $this->assertSame( 1, bbp_get_forum_topic_count( $f, false, true ) ); // Topic count
    51         $this->assertSame( 1, bbp_get_forum_topic_count( $f, true, true ) );  // Total topic count
    52         $this->assertSame( 0, bbp_get_forum_topic_count_hidden( $f, true ) ); // Topic count hidden
    53         $this->assertSame( 1, bbp_get_forum_reply_count( $f, false, true ) ); // Reply count
    54         $this->assertSame( 1, bbp_get_forum_reply_count( $f, true, true ) );  // Total reply count
    55         $this->assertSame( 2, bbp_get_forum_post_count( $f, false, true ) );  // Post count
    56         $this->assertSame( 2, bbp_get_forum_post_count( $f, true, true ) );   // Total post count
     54        $this->assertSame( 1, bbp_get_forum_topic_count( $f, false, true ) );
     55        $this->assertSame( 1, bbp_get_forum_topic_count( $f, true, true ) );
     56        $this->assertSame( 0, bbp_get_forum_topic_count_hidden( $f, true ) );
     57        $this->assertSame( 1, bbp_get_forum_reply_count( $f, false, true ) );
     58        $this->assertSame( 1, bbp_get_forum_reply_count( $f, true, true ) );
     59        $this->assertSame( 2, bbp_get_forum_post_count( $f, false, true ) );
     60        $this->assertSame( 2, bbp_get_forum_post_count( $f, true, true ) );
    5761        $this->assertSame( $t, bbp_get_forum_last_topic_id( $f ) );
    5862        $this->assertSame( $r, bbp_get_forum_last_reply_id( $f ) );
Note: See TracChangeset for help on using the changeset viewer.