[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/tests/phpunit/testcases/routing/ -> xprofile.php (source)

   1  <?php
   2  /**
   3   * @group xprofile
   4   * @group routing
   5   */
   6  class BP_Tests_Routing_XProfile extends BP_UnitTestCase {
   7      protected $old_current_user = 0;
   8  
   9  	public function setUp() {
  10          parent::setUp();
  11  
  12          $this->old_current_user = get_current_user_id();
  13          $this->set_current_user( self::factory()->user->create( array( 'role' => 'subscriber' ) ) );
  14      }
  15  
  16  	public function tearDown() {
  17          parent::tearDown();
  18          $this->set_current_user( $this->old_current_user );
  19      }
  20  
  21  	function test_member_profile() {
  22          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_profile_slug() );
  23          $this->assertTrue( bp_is_user_profile() );
  24      }
  25  
  26  	function test_member_profile_edit() {
  27          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_profile_slug() . '/edit' );
  28          $this->assertTrue( bp_is_user_profile_edit() );
  29      }
  30  
  31  	function test_member_profile_change_avatar() {
  32          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_profile_slug() . '/change-avatar' );
  33          $this->assertTrue( bp_is_user_change_avatar() );
  34      }
  35  }


Generated: Sat Dec 7 01:01:37 2019 Cross-referenced by PHPXref 0.7.1