[buddypress-trac] [BuddyPress Trac] #6128: buddypress()->activity->actions in unit tests

buddypress-trac noreply at wordpress.org
Fri Jan 16 22:45:59 UTC 2015

#6128: buddypress()->activity->actions in unit tests
 Reporter:  imath         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  2.2
Component:  Unit Tests    |    Version:
 Severity:  normal        |   Keywords:  has-patch 2nd-opinion
 If you look at #6126, you'll see that i've discovered a trouble when
 directly using {{{BP_Activity_Activity( $id )}}}. I've found this bug
 lately because when running the complete tests suite, everything seemed to
 work fine. It's only when i've run only a couple of tests i've discovered
 this issue.

 The problem was located in tests where i wasn't resetting the global
 {{{buddypress()->activity->actions}}} the right way. As a result the
 following tests were not only dealing with the default activity actions
 but also with post types activities actions.
 I've also discovered some other troubles like the fact once a post type
 (for instance the 'page' one) were added to the post types to track, some
 {{{bp_activity}}} properties were still set for the following tests.

 So i've edited each test and made sure the globals were properly reset ->
 see '''*.pertest.patch'''

 But as boonebgorges suggested in this
 [https://buddypress.trac.wordpress.org/ticket/6126#comment:6 comment], i
 think we should use the `BP_UnitTestCase->setUp()` method to be sure for
 the future tests we'll build we won't have to think about how to
 completely reset globals a test about post types activities edited. This
 way each new test will always get a default
 {{{buddypress()->activity->actions}}}. -> see '''*.setUp.patch'''

 What do you think ?

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6128>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list