[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * @group settings
   4   * @group routing
   5   */
   6  class BP_Tests_Routing_Settings 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_settings() {
  22          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_settings_slug() );
  23          $this->assertTrue( bp_is_user_settings_general() );
  24      }
  25  
  26  	function test_member_settings_notifications() {
  27          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_settings_slug() . '/notifications' );
  28          $this->assertTrue( bp_is_user_settings_notifications() );
  29      }
  30  
  31      // @todo How best to test this?
  32      /*function bp_is_user_settings_account_capbilities() {
  33          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_settings_slug() . '/capabilities' );
  34      }*/
  35  
  36  	function bp_is_user_settings_account_delete() {
  37          $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_settings_slug() . '/delete-account' );
  38          $this->assertTrue( bp_is_user_settings_account_delete() );
  39      }
  40  }


Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1