Changeset 5925
- Timestamp:
- 08/24/2015 09:55:26 AM (9 years ago)
- Location:
- trunk/tests/phpunit/testcases
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/forums/functions/forum.php
r5863 r5925 19 19 20 20 $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 ); 22 22 23 23 $t = $this->factory->topic->create( array( … … 38 38 ) ); 39 39 40 // Forum post 40 // Get the forum. 41 $forum = bbp_get_forum( $f ); 42 43 // Forum post. 41 44 $this->assertSame( 'Forum 1', bbp_get_forum_title( $f ) ); 42 45 $this->assertSame( 'Content of Forum 1', bbp_get_forum_content( $f ) ); … … 45 48 $this->assertTrue( bbp_is_forum_public( $f ) ); 46 49 $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. 49 53 $this->assertSame( 0, bbp_get_forum_subforum_count( $f, true ) ); 50 $this->assertSame( 1, bbp_get_forum_topic_count( $f, false, true ) ); // Topic count51 $this->assertSame( 1, bbp_get_forum_topic_count( $f, true, true ) ); // Total topic count52 $this->assertSame( 0, bbp_get_forum_topic_count_hidden( $f, true ) ); // Topic count hidden53 $this->assertSame( 1, bbp_get_forum_reply_count( $f, false, true ) ); // Reply count54 $this->assertSame( 1, bbp_get_forum_reply_count( $f, true, true ) ); // Total reply count55 $this->assertSame( 2, bbp_get_forum_post_count( $f, false, true ) ); // Post count56 $this->assertSame( 2, bbp_get_forum_post_count( $f, true, true ) ); // Total post count54 $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 ) ); 57 61 $this->assertSame( $t, bbp_get_forum_last_topic_id( $f ) ); 58 62 $this->assertSame( $r, bbp_get_forum_last_reply_id( $f ) ); -
trunk/tests/phpunit/testcases/replies/functions/reply.php
r5779 r5925 33 33 ) ); 34 34 35 // reply post 35 // Get the reply. 36 $reply = bbp_get_reply( $r ); 37 38 // Reply post. 36 39 $this->assertSame( 'Reply To: Topic 1', bbp_get_reply_title( $r ) ); 37 40 $this->assertSame( 'publish', bbp_get_reply_status( $r ) ); 38 $this->assertSame( $t, wp_get_post_parent_id( $r ) ); // post parent 39 40 // reply meta 41 $this->assertSame( $f, bbp_get_reply_forum_id( $r ) ); // _bbp_forum_id 42 $this->assertSame( $t, bbp_get_reply_topic_id( $r ) ); // _bbp_forum_id 41 $this->assertSame( $t, wp_get_post_parent_id( $r ) ); 42 $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/?reply=' . $reply->post_name, $reply->guid ); 43 44 // Reply meta. 45 $this->assertSame( $f, bbp_get_reply_forum_id( $r ) ); 46 $this->assertSame( $t, bbp_get_reply_topic_id( $r ) ); 43 47 } 44 48 -
trunk/tests/phpunit/testcases/topics/functions/topic.php
r5915 r5925 19 19 20 20 $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 ); 22 22 23 23 $t = $this->factory->topic->create( array( … … 38 38 ) ); 39 39 40 // Topic post 40 // Get the topic. 41 $topic = bbp_get_topic( $t ); 42 43 // Topic post. 41 44 $this->assertSame( 'Topic 1', bbp_get_topic_title( $t ) ); 42 45 $this->assertSame( 'publish', bbp_get_topic_status( $t ) ); 43 $this->assertSame( $f, wp_get_post_parent_id( $t ) ); // post parent 44 45 // Topic meta 46 $this->assertSame( $f, bbp_get_topic_forum_id( $t ) ); // _bbp_forum_id 46 $this->assertSame( $f, wp_get_post_parent_id( $t ) ); 47 $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/?topic=' . $topic->post_name, $topic->guid ); 48 49 // Topic meta. 50 $this->assertSame( $f, bbp_get_topic_forum_id( $t ) ); 47 51 $this->assertSame( 1, bbp_get_topic_reply_count( $t, true ) ); 48 52 $this->assertSame( 0, bbp_get_topic_reply_count_hidden( $t, true ) );
Note: See TracChangeset
for help on using the changeset viewer.