- Timestamp:
- 03/07/2023 04:28:08 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/activity/notifications.php
r13414 r13433 7 7 #[AllowDynamicProperties] 8 8 class BP_Tests_Activity_Notifications extends BP_UnitTestCase { 9 protected $permalink_structure = ''; 9 10 protected $current_user; 10 11 protected $u1; … … 15 16 public function set_up() { 16 17 parent::set_up(); 18 $this->permalink_structure = get_option( 'permalink_structure', '' ); 17 19 $this->current_user = get_current_user_id(); 18 20 $this->u1 = self::factory()->user->create(); … … 31 33 public function tear_down() { 32 34 $this->set_current_user( $this->current_user ); 35 $this->set_permalink_structure( $this->permalink_structure ); 36 33 37 parent::tear_down(); 34 38 … … 43 47 public function test_bp_activity_remove_screen_notifications_on_single_activity_permalink() { 44 48 $this->create_notifications(); 49 $this->set_permalink_structure( '/%postname%/' ); 45 50 46 51 $notifications = BP_Notifications_Notification::get( array( … … 52 57 53 58 // Go to the activity permalink page 54 $this->go_to( bp_core_get_user_domain( $this->u1 ) . 'activity/' . $this->a1 ); 59 $this->go_to( 60 bp_members_get_user_url( 61 $this->u1, 62 array( 63 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_activity', bp_get_activity_slug() ), 64 'single_item_action' => $this->a1, 65 ) 66 ) 67 ); 55 68 56 69 $notifications = BP_Notifications_Notification::get( array( … … 68 81 public function test_bp_activity_remove_screen_notifications_on_single_activity_permalink_logged_out() { 69 82 $this->create_notifications(); 83 $this->set_permalink_structure( '/%postname%/' ); 70 84 71 85 $notifications = BP_Notifications_Notification::get( array( … … 80 94 81 95 // Go to the activity permalink page 82 $this->go_to( bp_core_get_user_domain( $this->u1 ) . 'activity/' . $this->a1 ); 96 $this->go_to( 97 bp_members_get_user_url( 98 $this->u1, 99 array( 100 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_activity', bp_get_activity_slug() ), 101 'single_item_action' => $this->a1, 102 ) 103 ) 104 ); 83 105 84 106 $notifications = BP_Notifications_Notification::get( array( … … 98 120 public function test_bp_activity_remove_screen_notifications_on_single_activity_permalink_wrong_user() { 99 121 $this->create_notifications(); 122 $this->set_permalink_structure( '/%postname%/' ); 100 123 101 124 $notifications = BP_Notifications_Notification::get( array( … … 110 133 111 134 // Go to the activity permalink page 112 $this->go_to( bp_core_get_user_domain( $this->u1 ) . 'activity/' . $this->a1 ); 135 $this->go_to( 136 bp_members_get_user_url( 137 $this->u1, 138 array( 139 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_activity', bp_get_activity_slug() ), 140 'single_item_action' => $this->a1, 141 ) 142 ) 143 ); 113 144 114 145 $notifications = BP_Notifications_Notification::get( array( … … 128 159 public function test_bp_activity_remove_screen_notifications_on_mentions() { 129 160 $this->create_notifications(); 161 $this->set_permalink_structure( '/%postname%/' ); 130 162 131 163 $notifications = BP_Notifications_Notification::get( array( … … 137 169 138 170 // Go to the My Activity page 139 $this->go_to( bp_core_get_user_domain( $this->u1 ) . bp_get_activity_slug() . '/mentions/' ); 171 $this->go_to( 172 bp_members_get_user_url( 173 $this->u1, 174 array( 175 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_activity', bp_get_activity_slug() ), 176 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_activity_mentions', 'mentions' ), 177 ) 178 ) 179 ); 140 180 141 181 $notifications = BP_Notifications_Notification::get( array( … … 153 193 public function test_bp_activity_remove_screen_notifications_on_mentions_logged_out() { 154 194 $this->create_notifications(); 195 $this->set_permalink_structure( '/%postname%/' ); 155 196 156 197 $notifications = BP_Notifications_Notification::get( array( … … 165 206 166 207 // Go to the My Activity page 167 $this->go_to( bp_core_get_user_domain( $this->u1 ) . bp_get_activity_slug() . '/mentions/' ); 208 $this->go_to( 209 bp_members_get_user_url( 210 $this->u1, 211 array( 212 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_activity', bp_get_activity_slug() ), 213 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_activity_mentions', 'mentions' ), 214 ) 215 ) 216 ); 168 217 169 218 $notifications = BP_Notifications_Notification::get( array( … … 184 233 public function test_bp_activity_remove_screen_notifications_on_mentions_wrong_user() { 185 234 $this->create_notifications(); 235 $this->set_permalink_structure( '/%postname%/' ); 186 236 187 237 $notifications = BP_Notifications_Notification::get( array( … … 196 246 197 247 // Go to the My Activity page 198 $this->go_to( bp_core_get_user_domain( $this->u1 ) . bp_get_activity_slug() . '/mentions/' ); 248 $this->go_to( 249 bp_members_get_user_url( 250 $this->u1, 251 array( 252 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_activity', bp_get_activity_slug() ), 253 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_activity_mentions', 'mentions' ), 254 ) 255 ) 256 ); 199 257 200 258 $notifications = BP_Notifications_Notification::get( array( … … 215 273 public function test_bp_activity_at_mention_delete_notification() { 216 274 $this->create_notifications(); 275 $this->set_permalink_structure( '/%postname%/' ); 217 276 218 277 $notifications = BP_Notifications_Notification::get( array(
Note: See TracChangeset
for help on using the changeset viewer.