[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * @group friends
   4   * @group routing
   5   */
   6  class BP_Tests_Routing_Friends 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_friends() {
  22          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_friends_slug() );
  23          $this->assertTrue( bp_is_user_friends() );
  24      }
  25  
  26  	function test_member_friends_requests() {
  27          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_friends_slug()  . '/requests' );
  28          $this->assertTrue( bp_is_user_friend_requests() );
  29      }
  30  }


Generated: Sun Dec 22 01:00:54 2024 Cross-referenced by PHPXref 0.7.1