Changeset 13343 for trunk/tests/phpunit/testcases/activity/functions.php
- Timestamp:
- 10/23/2022 02:21:19 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/activity/functions.php
r13146 r13343 856 856 } 857 857 858 $b = self::factory()->blog->create(); 859 $u = self::factory()->user->create(); 858 $bp = buddypress(); 859 $b = self::factory()->blog->create(); 860 $u = self::factory()->user->create(); 861 $reset = $bp->activity->track; 860 862 861 863 switch_to_blog( $b ); 864 865 $bp->activity->track = array(); 862 866 863 867 register_post_type( 'foo', array( … … 884 888 885 889 _unregister_post_type( 'foo' ); 886 bp_activity_get_actions();887 888 890 restore_current_blog(); 889 891 890 $a = self::factory()->activity->create( $activity_args ); 891 892 $a = self::factory()->activity->create( $activity_args ); 892 893 $a_obj = new BP_Activity_Activity( $a ); 893 894 … … 899 900 900 901 $expected = sprintf( '%s wrote a new %s, on the site %s', $user_link, $post_link, '<a href="' . $blog_url . '">' . get_blog_option( $a_obj->item_id, 'blogname' ) . '</a>' ); 902 $bp->activity->track = $reset; 901 903 902 904 $this->assertSame( $expected, $a_obj->action ); … … 968 970 } 969 971 970 $b = self::factory()->blog->create(); 971 $u = self::factory()->user->create(); 972 $bp = buddypress(); 973 $b = self::factory()->blog->create(); 974 $u = self::factory()->user->create(); 975 $reset = $bp->activity->track; 972 976 973 977 switch_to_blog( $b ); 978 979 $bp->activity->track = array(); 974 980 975 981 $labels = array( … … 1010 1016 1011 1017 $user_link = bp_core_get_userlink( $u ); 1012 $blog_url = get_blog_option( $a_obj->item_id, 'home' );1013 $post_url = add_query_arg( 'p', $p, trailingslashit( $blog_url ) );1018 $blog_url = get_blog_option( $a_obj->item_id, 'home' ); 1019 $post_url = add_query_arg( 'p', $p, trailingslashit( $blog_url ) ); 1014 1020 1015 1021 $expected = sprintf( '%1$s shared a new <a href="%2$s">bar</a>, on the site %3$s', $user_link, $post_url, '<a href="' . $blog_url . '">' . get_blog_option( $a_obj->item_id, 'blogname' ) . '</a>' ); 1022 $bp->activity->track = $reset; 1016 1023 1017 1024 $this->assertSame( $expected, $a_obj->action ); … … 1098 1105 */ 1099 1106 public function test_bp_activity_format_activity_action_custom_post_type_comment() { 1107 $bp = buddypress(); 1108 $reset = $bp->activity->track; 1109 1100 1110 if ( is_multisite() ) { 1101 1111 $b = self::factory()->blog->create(); 1112 1102 1113 switch_to_blog( $b ); 1114 1115 $bp->activity->track = array(); 1103 1116 add_filter( 'comment_flood_filter', '__return_false' ); 1104 1117 } else { … … 1160 1173 1161 1174 $expected = sprintf( $labels['bp_activity_new_comment_ms'], $user_link, $comment_url, '<a href="' . $blog_url . '">' . get_blog_option( $a_obj->item_id, 'blogname' ) . '</a>' ); 1175 1176 $bp->activity->track = $reset; 1162 1177 } else { 1163 1178 $expected = sprintf( $labels['bp_activity_new_comment'], $user_link, $comment_url );
Note: See TracChangeset
for help on using the changeset viewer.