Skip to:
Content

bbPress.org

Changeset 5740


Ignore:
Timestamp:
05/13/2015 02:06:19 AM (10 years ago)
Author:
netweb
Message:

Tests: Test an array of posts not the total post counts:

  • Test the forum's topic ids in test_bbp_forum_query_topic_ids()
  • Test the forum's subforum ids in test_bbp_forum_query_subforum_ids()

Props thebrandonallen, netweb. See #2801

File:
1 edited

Legend:

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

    r5707 r5740  
    2727        $f = $this->factory->forum->create();
    2828
    29         $this->factory->topic->create_many( 9, array(
     29        $t1 = $this->factory->topic->create( array(
    3030            'post_parent' => $f,
    3131        ) );
    3232
    33         bbp_update_forum_topic_count( $f );
     33        $t2 = $this->factory->topic->create( array(
     34            'post_parent' => $f,
     35        ) );
    3436
    35         $count = count( bbp_forum_query_topic_ids( $f ) );
    36         $this->assertSame( 9, $count );;
     37        $t3 = $this->factory->topic->create( array(
     38            'post_parent' => $f,
     39        ) );
     40
     41        $this->assertEqualSets( array( $t1, $t2, $t3 ), bbp_forum_query_topic_ids( $f ) );
    3742    }
    3843
     
    4348        $f1 = $this->factory->forum->create();
    4449
    45         $f2 = $this->factory->forum->create_many( 9, array(
     50        $f2 = $this->factory->forum->create( array(
    4651            'post_parent' => $f1,
    4752        ) );
    4853
    49         $count = count( bbp_forum_query_subforum_ids( $f1 ) );
    50         $this->assertSame( 9, $count );;
     54        $f3 = $this->factory->forum->create( array(
     55            'post_parent' => $f1,
     56        ) );
     57
     58        $this->assertEqualSets( array( $f2, $f3 ), bbp_forum_query_subforum_ids( $f1 ) );
    5159    }
    5260
Note: See TracChangeset for help on using the changeset viewer.