[buddypress-trac] [BuddyPress Trac] #5477: Allow bp_has_groups to return all groups
buddypress-trac
noreply at wordpress.org
Wed Aug 13 01:00:36 UTC 2014
#5477: Allow bp_has_groups to return all groups
-------------------------------------------------+-------------------------
Reporter: dcavins | Owner: dcavins
Type: enhancement | Status: assigned
Priority: normal | Milestone: 2.2
Component: Groups | Version:
Severity: minor | Resolution:
Keywords: has-patch needs-unit-tests dev- |
feedback |
-------------------------------------------------+-------------------------
Comment (by boonebgorges):
Testing `BP_Groups_Group::get()` is good - the lower down the stack the
better.
The basic logic of the test looks good. The one thing I'd say is that the
no-pagination tests don't really show much, since you'd get the same
results with the default pagination args (per_page=20,page=1). It's
annoying, but I think that to test this you need to create more than 20
groups. To save CPU overhead, do it in a single test and run multiple
assertions on it. And no need to bother with the varying timestamps, since
you're just checking counts (and thus don't care about the order). So:
{{{
$group_ids = array();
for ( $i = 1; $i <= 25; $i++ ) {
$group_ids[] = $this->factory->group->create();
}
}}}
Then go ahead and run all of your three different pagination assertions in
the same test, on the same data.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5477#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list