[buddypress-trac] [BuddyPress Trac] #7048: Move permission checks in `bp_activity_screen_single_activity_permalink` into new function

buddypress-trac noreply at wordpress.org
Wed Jan 3 13:00:58 UTC 2018

#7048: Move permission checks in `bp_activity_screen_single_activity_permalink`
into new function
 Reporter:  DJPaul                    |       Owner:
     Type:  enhancement               |      Status:  assigned
 Priority:  high                      |   Milestone:  3.0
Component:  Activity                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |

Comment (by DJPaul):

 The unit tests `test_bp_activity_permalink_access` tests multiple things,
 so should be split up into smaller separate tests.
 The test names should also not be the same as a function or a class. Make
 them readable by humans -- something like
 "test_user_cant_access_someone_elses_activity". That way, when they fail
 or pass, you can see in the terminal output what the purpose of the test
 was that has passed or failed (no need to open the code just to find that

 Not sure why `get_activity_object()` was made in the tests, can we not use
 the activity factory?

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7048#comment:11>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list