Changeset 9042
- Timestamp:
- 09/25/2014 05:16:05 PM (10 years ago)
- Location:
- branches/2.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.1/src/bp-activity/bp-activity-template.php
r8975 r9042 1695 1695 // quite powerful, because doing so also deletes all comments to that 1696 1696 // activity item. We should revisit this eventually. 1697 if ( isset( $activity->user_id ) && ( $activity->user_id === bp_loggedin_user_id() ) ) {1697 if ( isset( $activity->user_id ) && ( (int) $activity->user_id === bp_loggedin_user_id() ) ) { 1698 1698 $can_delete = true; 1699 1699 } -
branches/2.1/tests/phpunit/testcases/activity/template.php
r8958 r9042 58 58 } 59 59 60 /** 61 * Test if a non-admin can delete their own activity. 62 */ 63 public function test_user_can_delete_for_nonadmin() { 64 // save the current user and override logged-in user 65 $old_user = get_current_user_id(); 66 $u = $this->create_user(); 67 $this->set_current_user( $u ); 68 69 // create an activity update for the user 70 $this->factory->activity->create( array( 71 'component' => buddypress()->activity->id, 72 'type' => 'activity_update', 73 'user_id' => $u, 74 ) ); 75 76 // start the activity loop 77 bp_has_activities( array( 'user_id' => $u ) ); 78 while ( bp_activities() ) : bp_the_activity(); 79 // assert! 80 $this->assertTrue( bp_activity_user_can_delete() ); 81 endwhile; 82 83 // reset 84 $this->set_current_user( $old_user ); 85 } 60 86 61 87 /**
Note: See TracChangeset
for help on using the changeset viewer.