Changeset 8082 for trunk/tests/testcases/xprofile/functions.php
- Timestamp:
- 03/08/2014 12:33:18 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/testcases/xprofile/functions.php
r7887 r8082 496 496 $this->assertNotEmpty( bp_xprofile_add_meta( $g, 'group', 'foo', 'baz' ) ); 497 497 } 498 499 /** 500 * @group bp_get_member_profile_data 501 */ 502 public function test_bp_get_member_profile_data_inside_loop() { 503 $u = $this->create_user(); 504 $g = $this->factory->xprofile_group->create(); 505 $f = $this->factory->xprofile_field->create( array( 506 'field_group_id' => $g, 507 'type' => 'textbox', 508 'name' => 'Neato', 509 ) ); 510 xprofile_set_field_data( $f, $u, 'foo' ); 511 512 if ( bp_has_members() ) : while ( bp_members() ) : bp_the_member(); 513 $found = bp_get_member_profile_data( array( 514 'user_id' => $u, 515 'field' => 'Neato', 516 ) ); 517 endwhile; endif; 518 519 // Cleanup 520 unset( $GLOBALS['members_template'] ); 521 522 $this->assertSame( 'foo', $found ); 523 } 524 /** 525 * @group bp_get_member_profile_data 526 */ 527 public function test_bp_get_member_profile_data_outside_of_loop() { 528 $u = $this->create_user(); 529 $g = $this->factory->xprofile_group->create(); 530 $f = $this->factory->xprofile_field->create( array( 531 'field_group_id' => $g, 532 'type' => 'textbox', 533 'name' => 'Kewl', 534 ) ); 535 xprofile_set_field_data( $f, $u, 'foo' ); 536 537 $found = bp_get_member_profile_data( array( 538 'user_id' => $u, 539 'field' => 'Kewl', 540 ) ); 541 542 $this->assertSame( 'foo', $found ); 543 } 498 544 }
Note: See TracChangeset
for help on using the changeset viewer.