[buddypress-trac] [BuddyPress Trac] #5477: Allow bp_has_groups to return all groups

buddypress-trac noreply at wordpress.org
Wed Aug 13 19:45:03 UTC 2014


#5477: Allow bp_has_groups to return all groups
-------------------------+----------------------
 Reporter:  dcavins      |       Owner:  dcavins
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  2.1
Component:  Groups       |     Version:
 Severity:  minor        |  Resolution:  fixed
 Keywords:  has-patch    |
-------------------------+----------------------

Comment (by boonebgorges):

 >  Besides, writing test cases is fun (especially now that I've got
 phpunit actually running, ha ha).

 Sing it!! Feel free to write tests for any part of BuddyPress you see fit
 :)

 >  Would it be useful for me to add some downstream tests of
 groups_get_groups() to the test case? I'm happy to do it if it's useful. I
 do think that testing groups_get_groups() would test pagination more
 completely.

 The only reason to test wrapper functions like `groups_get_groups()` is if
 those wrappers do something to modify what goes into the wrapped function.
 `groups_get_groups()` doesn't really do anything but set some default
 values. So, it would be non-redundant to write tests that ensure that
 those default values are working correctly. (Eg, `groups_get_groups()`
 with no params should return 20 groups.) That said, as a rule, it's not
 really worth writing these kinds of tests when there are loads of lower-
 level functions that have no coverage at all - especially database
 methods. So, if you've got the hankering, you should go to those instead.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5477#comment:12>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list