[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * @group messages
   4   * @group routing
   5   */
   6  class BP_Tests_Routing_Messages 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_messages() {
  22          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_messages_slug() );
  23          $this->assertTrue( bp_is_messages_inbox() );
  24      }
  25  
  26  	function test_member_messages_sentbox() {
  27          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_messages_slug() . '/sentbox' );
  28          $this->assertTrue( bp_is_messages_sentbox() );
  29      }
  30  
  31  	function test_member_messages_compose() {
  32          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_messages_slug() . '/compose' );
  33          $this->assertTrue( bp_is_messages_compose_screen() );
  34      }
  35  
  36  	function test_member_messages_notices() {
  37          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_messages_slug() . '/notices' );
  38          $this->assertTrue( bp_is_notices() );
  39      }
  40  }


Generated: Tue Dec 3 01:00:55 2024 Cross-referenced by PHPXref 0.7.1