Changeset 8125 for trunk/tests/testcases/xprofile/activity.php
- Timestamp:
- 03/13/2014 06:34:06 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/testcases/xprofile/activity.php
r8016 r8125 271 271 } 272 272 273 /** 274 * @group activity_action 275 * @group bp_xprofile_format_activity_action_new_avatar 276 */ 277 public function test_bp_xprofile_format_activity_action_new_avatar() { 278 $u = $this->create_user(); 279 $a = $this->factory->activity->create( array( 280 'component' => buddypress()->profile->id, 281 'type' => 'new_avatar', 282 'user_id' => $u, 283 ) ); 284 285 $expected = sprintf( __( '%s changed their profile picture', 'buddypress' ), bp_core_get_userlink( $u ) ); 286 287 $a_obj = new BP_Activity_Activity( $a ); 288 289 $this->assertSame( $expected, $a_obj->action ); 290 } 291 292 /** 293 * @group activity_action 294 * @group bp_xprofile_format_activity_action_new_member 295 */ 296 public function test_bp_xprofile_format_activity_action_new_member_xprofile_on() { 297 $active = bp_is_active( 'xprofile' ); 298 buddypress()->active_components['xprofile'] = '1'; 299 300 $u = $this->create_user(); 301 $a = $this->factory->activity->create( array( 302 'component' => buddypress()->profile->id, 303 'type' => 'new_member', 304 'user_id' => $u, 305 ) ); 306 307 $expected = sprintf( __( '%s became a registered member', 'buddypress' ), bp_core_get_userlink( $u ) ); 308 309 $a_obj = new BP_Activity_Activity( $a ); 310 311 $this->assertSame( $expected, $a_obj->action ); 312 313 if ( ! $active ) { 314 unset( buddypress()->active_components['xprofile'] ); 315 } 316 } 317 318 /** 319 * @group activity_action 320 * @group bp_xprofile_format_activity_action_new_member 321 */ 322 public function test_bp_xprofile_format_activity_action_new_member_xprofile_off() { 323 $active = bp_is_active( 'xprofile' ); 324 unset( buddypress()->active_components['xprofile'] ); 325 326 $u = $this->create_user(); 327 $a = $this->factory->activity->create( array( 328 'component' => buddypress()->profile->id, 329 'type' => 'new_member', 330 'user_id' => $u, 331 ) ); 332 333 $expected = sprintf( __( '%s became a registered member', 'buddypress' ), bp_core_get_userlink( $u ) ); 334 335 $a_obj = new BP_Activity_Activity( $a ); 336 337 $this->assertSame( $expected, $a_obj->action ); 338 339 if ( $active ) { 340 buddypress()->active_components['xprofile'] = '1'; 341 } 342 } 343 344 /** 345 * @group activity_action 346 * @group bp_xprofile_format_activity_action_updated_profile 347 */ 348 public function test_bp_xprofile_format_activity_action_updated_profile() { 349 $u = $this->create_user(); 350 $a = $this->factory->activity->create( array( 351 'component' => buddypress()->profile->id, 352 'type' => 'updated_profile', 353 'user_id' => $u, 354 ) ); 355 356 $expected = sprintf( __( '%s’s profile was updated', 'buddypress' ), '<a href="' . bp_core_get_user_domain( $u ) . buddypress()->profile->slug . '/">' . bp_core_get_user_displayname( $u ) . '</a>' ); 357 358 $a_obj = new BP_Activity_Activity( $a ); 359 360 $this->assertSame( $expected, $a_obj->action ); 361 } 273 362 274 363 protected function setup_updated_profile_data() {
Note: See TracChangeset
for help on using the changeset viewer.