<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][12851] trunk: The `new_avatar` activity belongs to the Members component</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/12851">12851</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/12851","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-02-21 20:10:55 +0000 (Sun, 21 Feb 2021)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>The `new_avatar` activity belongs to the Members component
The activity generated when members add/update their profile photo wasn't migrated to the Members component during the 6.0.0 milestone. This commit's goal is to repare this oversight.
See <a href="http://buddypress.trac.wordpress.org/ticket/8156">#8156</a>
See <a href="http://buddypress.trac.wordpress.org/ticket/8407">#8407</a>
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/8408">#8408</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpcorebpcoreupdatephp">trunk/src/bp-core/bp-core-update.php</a></li>
<li><a href="#trunksrcbpmembersbpmembersactivityphp">trunk/src/bp-members/bp-members-activity.php</a></li>
<li><a href="#trunksrcbpxprofilebpxprofileactivityphp">trunk/src/bp-xprofile/bp-xprofile-activity.php</a></li>
<li><a href="#trunksrcclassbuddypressphp">trunk/src/class-buddypress.php</a></li>
<li><a href="#trunktestsphpunittestcasesmembersactivityphp">trunk/tests/phpunit/testcases/members/activity.php</a></li>
<li><a href="#trunktestsphpunittestcasesxprofileactivityphp">trunk/tests/phpunit/testcases/xprofile/activity.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcbpcoredeprecated80php">trunk/src/bp-core/deprecated/8.0.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpcorebpcoreupdatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-update.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-update.php 2021-02-18 00:51:29 UTC (rev 12850)
+++ trunk/src/bp-core/bp-core-update.php 2021-02-21 20:10:55 UTC (rev 12851)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -273,6 +273,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $raw_db_version < 12385 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> bp_update_to_5_0();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Version 8.0.0.
+ if ( $raw_db_version < 12850 ) {
+ bp_update_to_8_0();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* All done! *************************************************************/
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -590,6 +595,35 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * 8.0.0 update routine.
+ *
+ * - Edit the `new_avatar` activity type's component to `members`.
+ *
+ * @since 8.0.0
+ */
+function bp_update_to_8_0() {
+ global $wpdb;
+ $bp_prefix = bp_core_get_table_prefix();
+
+ // Update the `new_avatar` activity type's component to `members`.
+ $wpdb->update(
+ $bp_prefix . 'bp_activity',
+ array(
+ 'component' => 'members',
+ ),
+ array(
+ 'type' => 'new_avatar',
+ ),
+ array(
+ '%s',
+ ),
+ array(
+ '%s',
+ )
+ );
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Updates the component field for new_members type.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.2.0
</span></span></pre></div>
<a id="trunksrcbpcoredeprecated80php"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/bp-core/deprecated/8.0.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/deprecated/8.0.php (rev 0)
+++ trunk/src/bp-core/deprecated/8.0.php 2021-02-21 20:10:55 UTC (rev 12851)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,40 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * Deprecated functions.
+ *
+ * @deprecated 8.0.0
+ */
+
+// Exit if accessed directly.
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Format 'new_avatar' activity actions.
+ *
+ * @since 2.0.0
+ * @deprecated 8.0.0
+ *
+ * @param string $action Static activity action.
+ * @param object $activity Activity object.
+ * @return string
+ */
+function bp_xprofile_format_activity_action_new_avatar( $action, $activity ) {
+ _deprecated_function( __FUNCTION__, '8.0.0', 'bp_members_format_activity_action_new_avatar()' );
+ return bp_members_format_activity_action_new_avatar( $action, $activity );
+}
+
+/**
+ * Adds an activity stream item when a user has uploaded a new avatar.
+ *
+ * @since 1.0.0
+ * @since 2.3.4 Add new parameter to get the user id the avatar was set for.
+ * @deprecated 8.0.0
+ *
+ * @param int $user_id The user id the avatar was set for.
+ * @return bool
+ */
+function bp_xprofile_new_avatar_activity( $user_id = 0 ) {
+ _deprecated_function( __FUNCTION__, '8.0.0', 'bp_members_new_avatar_activity()' );
+ return bp_members_new_avatar_activity( $user_id );
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/bp-core/deprecated/8.0.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcbpmembersbpmembersactivityphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-members/bp-members-activity.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-members/bp-members-activity.php 2021-02-18 00:51:29 UTC (rev 12850)
+++ trunk/src/bp-members/bp-members-activity.php 2021-02-21 20:10:55 UTC (rev 12851)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,6 +27,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'activity' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Register the activity stream actions for this component.
+ bp_activity_set_action(
+ // Older avatar activity items use 'profile' for component. See r4273.
+ buddypress()->members->id,
+ 'new_avatar',
+ __( 'Member changed profile picture', 'buddypress' ),
+ 'bp_members_format_activity_action_new_avatar',
+ __( 'Updated Profile Photos', 'buddypress' )
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires after the default 'new member' activity types are registered.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,6 +78,40 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Format 'new_avatar' activity actions.
+ *
+ * @since 8.0.0
+ *
+ * @param string $action Static activity action.
+ * @param object $activity Activity object.
+ * @return string
+ */
+function bp_members_format_activity_action_new_avatar( $action, $activity ) {
+ $userlink = bp_core_get_userlink( $activity->user_id );
+
+ /* translators: %s: user link */
+ $action = sprintf( esc_html__( '%s changed their profile picture', 'buddypress' ), $userlink );
+
+ // Legacy filter - pass $user_id instead of $activity.
+ if ( has_filter( 'bp_xprofile_new_avatar_action' ) ) {
+ $action = apply_filters( 'bp_xprofile_new_avatar_action', $action, $activity->user_id );
+ }
+
+ /** This filter is documented in wp-includes/deprecated.php */
+ $action = apply_filters_deprecated( 'bp_xprofile_format_activity_action_new_avatar', array( $action, $activity ), '8.0.0', 'bp_members_format_activity_action_new_avatar' );
+
+ /**
+ * Filters the formatted 'new_avatar' activity stream action.
+ *
+ * @since 8.0.0
+ *
+ * @param string $action Formatted action for activity stream.
+ * @param object $activity Activity object.
+ */
+ return apply_filters( 'bp_members_format_activity_action_new_avatar', $action, $activity );
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Create a "became a registered user" activity item when a user activates his account.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.2.2
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,3 +141,42 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/**
+ * Adds an activity stream item when a user has uploaded a new avatar.
+ *
+ * @since 8.0.0
+ *
+ * @param int $user_id The user id the avatar was set for.
+ */
+function bp_members_new_avatar_activity( $user_id = 0 ) {
+
+ // Bail if activity component is not active.
+ if ( ! bp_is_active( 'activity' ) ) {
+ return false;
+ }
+
+ if ( empty( $user_id ) ) {
+ $user_id = bp_displayed_user_id();
+ }
+
+ /** This filter is documented in wp-includes/deprecated.php */
+ $user_id = apply_filters_deprecated( 'bp_xprofile_new_avatar_user_id', array( $user_id ), '8.0.0', 'bp_members_new_avatar_user_id' );
+
+ /**
+ * Filters the user ID when a user has uploaded a new avatar.
+ *
+ * @since 8.0.0
+ *
+ * @param int $user_id ID of the user the avatar was set for.
+ */
+ $user_id = apply_filters( 'bp_members_new_avatar_user_id', $user_id );
+
+ // Add the activity.
+ bp_activity_add( array(
+ 'user_id' => $user_id,
+ 'component' => buddypress()->members->id,
+ 'type' => 'new_avatar'
+ ) );
+}
+add_action( 'bp_members_avatar_uploaded', 'bp_members_new_avatar_activity' );
</ins></span></pre></div>
<a id="trunksrcbpxprofilebpxprofileactivityphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-xprofile/bp-xprofile-activity.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-xprofile/bp-xprofile-activity.php 2021-02-18 00:51:29 UTC (rev 12850)
+++ trunk/src/bp-xprofile/bp-xprofile-activity.php 2021-02-21 20:10:55 UTC (rev 12851)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,17 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function xprofile_register_activity_actions() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Register the activity stream actions for this component.
</del><span class="cx" style="display: block; padding: 0 10px"> bp_activity_set_action(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Older avatar activity items use 'profile' for component. See r4273.
- 'profile',
- 'new_avatar',
- __( 'Member changed profile picture', 'buddypress' ),
- 'bp_xprofile_format_activity_action_new_avatar',
- __( 'Updated Profile Photos', 'buddypress' )
- );
-
- bp_activity_set_action(
</del><span class="cx" style="display: block; padding: 0 10px"> buddypress()->profile->id,
</span><span class="cx" style="display: block; padding: 0 10px"> 'updated_profile',
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Updated Profile', 'buddypress' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,37 +40,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_register_activity_actions', 'xprofile_register_activity_actions' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Format 'new_avatar' activity actions.
- *
- * @since 2.0.0
- *
- * @param string $action Static activity action.
- * @param object $activity Activity object.
- * @return string
- */
-function bp_xprofile_format_activity_action_new_avatar( $action, $activity ) {
- $userlink = bp_core_get_userlink( $activity->user_id );
-
- /* translators: %s: user link */
- $action = sprintf( esc_html__( '%s changed their profile picture', 'buddypress' ), $userlink );
-
- // Legacy filter - pass $user_id instead of $activity.
- if ( has_filter( 'bp_xprofile_new_avatar_action' ) ) {
- $action = apply_filters( 'bp_xprofile_new_avatar_action', $action, $activity->user_id );
- }
-
- /**
- * Filters the formatted 'new_avatar' activity stream action.
- *
- * @since 2.0.0
- *
- * @param string $action Formatted action for activity stream.
- * @param object $activity Activity object.
- */
- return apply_filters( 'bp_xprofile_format_activity_action_new_avatar', $action, $activity );
-}
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * Format 'updated_profile' activity actions.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,46 +159,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Adds an activity stream item when a user has uploaded a new avatar.
- *
- * @since 1.0.0
- * @since 2.3.4 Add new parameter to get the user id the avatar was set for.
- *
- * specific activity
- *
- * @param int $user_id The user id the avatar was set for.
- * @return bool
- */
-function bp_xprofile_new_avatar_activity( $user_id = 0 ) {
-
- // Bail if activity component is not active.
- if ( ! bp_is_active( 'activity' ) ) {
- return false;
- }
-
- if ( empty( $user_id ) ) {
- $user_id = bp_displayed_user_id();
- }
-
- /**
- * Filters the user ID when a user has uploaded a new avatar.
- *
- * @since 1.5.0
- *
- * @param int $user_id ID of the user the avatar was set for.
- */
- $user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', $user_id );
-
- // Add the activity.
- bp_activity_add( array(
- 'user_id' => $user_id,
- 'component' => 'profile',
- 'type' => 'new_avatar'
- ) );
-}
-add_action( 'bp_members_avatar_uploaded', 'bp_xprofile_new_avatar_activity' );
-
-/**
</del><span class="cx" style="display: block; padding: 0 10px"> * Add an activity item when a user has updated his profile.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.0
</span></span></pre></div>
<a id="trunksrcclassbuddypressphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/class-buddypress.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/class-buddypress.php 2021-02-18 00:51:29 UTC (rev 12850)
+++ trunk/src/class-buddypress.php 2021-02-21 20:10:55 UTC (rev 12851)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,7 +304,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /** Versions **********************************************************/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->version = '8.0.0-alpha';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->db_version = 12385;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->db_version = 12850;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Loading ***********************************************************/
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestcasesmembersactivityphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/testcases/members/activity.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/testcases/members/activity.php 2021-02-18 00:51:29 UTC (rev 12850)
+++ trunk/tests/phpunit/testcases/members/activity.php 2021-02-21 20:10:55 UTC (rev 12851)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,6 +26,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @group activity_action
+ * @group bp_members_format_activity_action_new_avatar
+ */
+ public function test_bp_members_format_activity_action_new_avatar() {
+ $u = self::factory()->user->create();
+ $a = self::factory()->activity->create( array(
+ 'component' => 'members',
+ 'type' => 'new_avatar',
+ 'user_id' => $u,
+ ) );
+
+ $expected = sprintf( __( '%s changed their profile picture', 'buddypress' ), bp_core_get_userlink( $u ) );
+
+ $a_obj = new BP_Activity_Activity( $a );
+
+ $this->assertSame( $expected, $a_obj->action );
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * @group bp_migrate_new_member_activity_component
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_bp_migrate_new_member_activity_component() {
</span></span></pre></div>
<a id="trunktestsphpunittestcasesxprofileactivityphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/testcases/xprofile/activity.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/testcases/xprofile/activity.php 2021-02-18 00:51:29 UTC (rev 12850)
+++ trunk/tests/phpunit/testcases/xprofile/activity.php 2021-02-21 20:10:55 UTC (rev 12851)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -296,25 +296,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @group activity_action
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @group bp_xprofile_format_activity_action_new_avatar
- */
- public function test_bp_xprofile_format_activity_action_new_avatar() {
- $u = self::factory()->user->create();
- $a = self::factory()->activity->create( array(
- 'component' => 'profile',
- 'type' => 'new_avatar',
- 'user_id' => $u,
- ) );
-
- $expected = sprintf( __( '%s changed their profile picture', 'buddypress' ), bp_core_get_userlink( $u ) );
-
- $a_obj = new BP_Activity_Activity( $a );
-
- $this->assertSame( $expected, $a_obj->action );
- }
-
- /**
- * @group activity_action
</del><span class="cx" style="display: block; padding: 0 10px"> * @group bp_xprofile_format_activity_action_updated_profile
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_bp_xprofile_format_activity_action_updated_profile() {
</span></span></pre>
</div>
</div>
</body>
</html>