Tests: update activity tests to use `bp_activity_get_permalink` to get a link to an activity item rather than manually constructing a link from an activity ID.

See #5926

git-svn-id: https://buddypress.svn.wordpress.org/trunk@9061 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Activity: when redirecting unauthenticated users away from a single activity permalink, make sure the value of the `redirect_to` parameter has been URL encoded.

Also improves the readability of this section of code by moving it out of the ternary operator.

See #5926

git-svn-id: https://buddypress.svn.wordpress.org/trunk@9062 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Activity: refactor part of `bp_get_activity_latest_update` to use `bp_activity_get_permalink` to get a link to an activity item rather than manually constructing the link.

See #5926

git-svn-id: https://buddypress.svn.wordpress.org/trunk@9063 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Merge branch 'master' into activity-permalinks