Skip to:
Content

BuddyPress.org

Changeset 9580


Ignore:
Timestamp:
03/02/2015 09:29:16 PM (5 years ago)
Author:
boonebgorges
Message:

Moar fixture elimination in groups template tests.

File:
1 edited

Legend:

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

    r9579 r9580  
    195195
    196196        $users = array();
    197         for ( $i = 1; $i <= 10; $i++ ) {
     197        for ( $i = 1; $i <= 5; $i++ ) {
    198198            $users[ $i ] = $this->factory->user->create();
    199199        }
     
    201201        $expected = array();
    202202        $now = time();
    203         for ( $i = 3; $i <= 10; $i++ ) {
     203        for ( $i = 3; $i <= 5; $i++ ) {
    204204            $this->add_user_to_group( $users[ $i ], $g, array(
    205205                'date_modified' => date( 'Y-m-d H:i:s', $now - ( 60 * $i ) ),
     
    208208        }
    209209
    210         // hack it down to 5 (per page arg below)
    211         $expected = array_slice( $expected, 0, 5 );
     210        // hack it down to 2 (per page arg below)
     211        $expected = array_slice( $expected, 0, 2 );
    212212
    213213        global $members_template;
    214214        bp_group_has_members( array(
    215215            'group_id' => $g,
    216             'per_page' => 5,
     216            'per_page' => 2,
    217217        ) );
    218218
     
    233233
    234234        $users = array();
    235         for ( $i = 1; $i <= 10; $i++ ) {
     235        for ( $i = 1; $i <= 5; $i++ ) {
    236236            $users[ $i ] = $this->factory->user->create();
    237237        }
    238238
    239239        $expected = array();
    240         for ( $i = 3; $i <= 10; $i++ ) {
     240        for ( $i = 3; $i <= 5; $i++ ) {
    241241            $this->add_user_to_group( $users[ $i ], $g );
    242242            $expected[] = $users[ $i ];
     
    246246        bp_group_has_members( array(
    247247            'group_id' => $g,
    248             'max' => 5,
    249         ) );
    250 
    251         $this->assertEquals( 5, $members_template->member_count );
     248            'max' => 1,
     249        ) );
     250
     251        $this->assertEquals( 1, $members_template->member_count );
    252252    }
    253253
Note: See TracChangeset for help on using the changeset viewer.