Skip to:
Content

BuddyPress.org

Changeset 7834


Ignore:
Timestamp:
02/09/2014 01:59:19 AM (11 years ago)
Author:
boonebgorges
Message:

Updates groupmeta unit tests to work with new WP API functions as well

The WP API has some additional caching requirements, so to make the tests work
for both the old and new functions, a few additional cache-clearings are
necessary.

See #4551

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/groups/functions.php

    r7833 r7834  
    360360        $metas = groups_get_groupmeta( $g );
    361361        $count = count( $metas );
    362         $this->assertSame( 'bar', $metas[ $count - 2 ] );
    363         $this->assertSame( 'is cool', $metas[ $count - 1 ] );
     362        $found = array_slice( $metas, $count - 2 );
     363
     364        $expected = array(
     365            'bar',
     366            'is cool',
     367        );
     368
     369        $this->assertSame( $expected, $found );
    364370    }
    365371
     
    371377
    372378        // Get rid of any auto-created values
    373         groups_delete_groupmeta( $g );
     379        global $wpdb, $bp;
     380        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $g ) );
     381        wp_cache_delete( $g, 'group_meta' );
    374382
    375383        $metas = groups_get_groupmeta( $g );
Note: See TracChangeset for help on using the changeset viewer.