Changeset 9476
- Timestamp:
- 02/11/2015 09:38:40 PM (10 years ago)
- Location:
- branches/2.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/src/bp-activity/bp-activity-filters.php
r9406 r9476 675 675 array( 676 676 'column' => 'user_id', 677 'value' => $ filter['user_id']677 'value' => $user_id 678 678 ), 679 679 $show_hidden, -
branches/2.2/tests/phpunit/testcases/activity/template.php
r9417 r9476 142 142 143 143 $activities_template = null; 144 } 145 146 /** 147 * @group scope 148 * @group filter_query 149 * @group BP_Activity_Query 150 */ 151 function test_bp_has_activities_just_me_scope_with_no_user_id() { 152 $u1 = $this->factory->user->create(); 153 $u2 = $this->factory->user->create(); 154 155 // save the current user and override logged-in user 156 $old_user = get_current_user_id(); 157 $this->set_current_user( $u1 ); 158 159 $now = time(); 160 161 // activity item 162 $a1 = $this->factory->activity->create( array( 163 'user_id' => $u1, 164 'component' => 'activity', 165 'type' => 'activity_update', 166 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 167 ) ); 168 169 // misc activity items 170 171 $this->factory->activity->create( array( 172 'user_id' => $u2, 173 'component' => 'activity', 174 'type' => 'activity_update', 175 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 176 ) ); 177 $this->factory->activity->create( array( 178 'user_id' => $u2, 179 'component' => 'groups', 180 'item_id' => 324, 181 'type' => 'activity_update', 182 'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ), 183 ) ); 184 185 global $activities_template; 186 187 // grab just-me scope with no user ID 188 // user ID should fallback to logged-in user ID 189 bp_has_activities( array( 190 'user_id' => false, 191 'scope' => 'just-me', 192 ) ); 193 194 // assert! 195 $this->assertEqualSets( array( $a1 ), wp_list_pluck( $activities_template->activities, 'id' ) ); 196 197 // clean up! 198 $activities_template = null; 199 $this->set_current_user( $old_user ); 144 200 } 145 201
Note: See TracChangeset
for help on using the changeset viewer.