- Timestamp:
- 05/03/2023 06:18:23 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/activity/notifications.php
r13436 r13468 46 46 */ 47 47 public function test_bp_activity_remove_screen_notifications_on_single_activity_permalink() { 48 $this->create_notifications(); 49 $this->set_permalink_structure( '/%postname%/' ); 50 51 $notifications = BP_Notifications_Notification::get( array( 52 'user_id' => $this->u1, 53 ) ); 54 55 // Double check it's there 56 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) ); 48 $this->set_permalink_structure( '/%postname%/' ); 49 $this->create_notifications(); 50 51 $notifications = BP_Notifications_Notification::get( array( 52 'user_id' => $this->u1, 53 ) ); 54 55 // Double check it's there 56 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) ); 57 $url = bp_members_get_user_url( 58 $this->u1, 59 array( 60 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_activity', bp_get_activity_slug() ), 61 'single_item_action' => $this->a1, 62 ) 63 ); 64 65 // Go to the activity permalink page 66 $this->go_to( $url ); 67 68 $notifications = BP_Notifications_Notification::get( array( 69 'user_id' => $this->u1, 70 ) ); 71 72 // Should be empty 73 $this->assertEquals( array(), $notifications ); 74 } 75 76 /** 77 * @group bp_activity_remove_screen_notifications 78 * @group mentions 79 */ 80 public function test_bp_activity_remove_screen_notifications_on_single_activity_permalink_logged_out() { 81 $this->create_notifications(); 82 $this->set_permalink_structure( '/%postname%/' ); 83 84 $notifications = BP_Notifications_Notification::get( array( 85 'user_id' => $this->u1, 86 ) ); 87 88 // Double check it's there 89 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) ); 90 91 // Log out 92 $this->set_current_user( 0 ); 57 93 58 94 // Go to the activity permalink page … … 71 107 ) ); 72 108 73 // Should be empty 74 $this->assertEquals( array(), $notifications ); 75 } 76 77 /** 78 * @group bp_activity_remove_screen_notifications 79 * @group mentions 80 */ 81 public function test_bp_activity_remove_screen_notifications_on_single_activity_permalink_logged_out() { 82 $this->create_notifications(); 83 $this->set_permalink_structure( '/%postname%/' ); 84 85 $notifications = BP_Notifications_Notification::get( array( 86 'user_id' => $this->u1, 87 ) ); 88 89 // Double check it's there 90 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) ); 91 92 // Log out 93 $this->set_current_user( 0 ); 109 // Should be untouched 110 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) ); 111 112 $this->set_current_user( $this->u1 ); 113 } 114 115 /** 116 * @group bp_activity_remove_screen_notifications 117 * @group mentions 118 */ 119 public function test_bp_activity_remove_screen_notifications_on_single_activity_permalink_wrong_user() { 120 $this->create_notifications(); 121 $this->set_permalink_structure( '/%postname%/' ); 122 123 $notifications = BP_Notifications_Notification::get( array( 124 'user_id' => $this->u1, 125 ) ); 126 127 // Double check it's there 128 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) ); 129 130 // Switch user 131 $this->set_current_user( $this->u2 ); 94 132 95 133 // Go to the activity permalink page … … 118 156 * @group mentions 119 157 */ 120 public function test_bp_activity_remove_screen_notifications_on_single_activity_permalink_wrong_user() {121 $this->create_notifications();122 $this->set_permalink_structure( '/%postname%/' );123 124 $notifications = BP_Notifications_Notification::get( array(125 'user_id' => $this->u1,126 ) );127 128 // Double check it's there129 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) );130 131 // Switch user132 $this->set_current_user( $this->u2 );133 134 // Go to the activity permalink page135 $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 );144 145 $notifications = BP_Notifications_Notification::get( array(146 'user_id' => $this->u1,147 ) );148 149 // Should be untouched150 $this->assertEquals( array( $this->a1 ), wp_list_pluck( $notifications, 'item_id' ) );151 152 $this->set_current_user( $this->u1 );153 }154 155 /**156 * @group bp_activity_remove_screen_notifications157 * @group mentions158 */159 158 public function test_bp_activity_remove_screen_notifications_on_mentions() { 160 159 $this->create_notifications();
Note: See TracChangeset
for help on using the changeset viewer.