Changeset 13433 for trunk/tests/phpunit/testcases/routing/messages.php
- Timestamp:
- 03/07/2023 04:28:08 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/routing/messages.php
r13314 r13433 6 6 class BP_Tests_Routing_Messages extends BP_UnitTestCase { 7 7 protected $old_current_user = 0; 8 protected $permalink_structure = ''; 8 9 9 10 public function set_up() { … … 11 12 12 13 $this->old_current_user = get_current_user_id(); 14 $this->permalink_structure = get_option( 'permalink_structure', '' ); 13 15 $this->set_current_user( self::factory()->user->create( array( 'role' => 'subscriber' ) ) ); 14 16 } … … 17 19 parent::tear_down(); 18 20 $this->set_current_user( $this->old_current_user ); 21 $this->set_permalink_structure( $this->permalink_structure ); 19 22 } 20 23 21 24 function test_member_messages() { 22 $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_messages_slug() ); 25 $this->set_permalink_structure( '/%postname%/' ); 26 $this->go_to( 27 bp_members_get_user_url( 28 bp_loggedin_user_id(), 29 array( 30 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 31 ) 32 ) 33 ); 23 34 $this->assertTrue( bp_is_messages_inbox() ); 24 35 } 25 36 26 37 function test_member_messages_sentbox() { 27 $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_messages_slug() . '/sentbox' ); 38 $this->set_permalink_structure( '/%postname%/' ); 39 $this->go_to( 40 bp_members_get_user_url( 41 bp_loggedin_user_id(), 42 array( 43 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 44 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_messages_sentbox', 'sentbox' ), 45 ) 46 ) 47 ); 28 48 $this->assertTrue( bp_is_messages_sentbox() ); 29 49 } 30 50 31 51 function test_member_messages_compose() { 32 $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_messages_slug() . '/compose' ); 52 $this->set_permalink_structure( '/%postname%/' ); 53 $this->go_to( 54 bp_members_get_user_url( 55 bp_loggedin_user_id(), 56 array( 57 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 58 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_messages_compose', 'compose' ), 59 ) 60 ) 61 ); 33 62 $this->assertTrue( bp_is_messages_compose_screen() ); 34 63 } 35 64 36 65 function test_member_messages_notices() { 37 $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_messages_slug() . '/notices' ); 66 $this->set_permalink_structure( '/%postname%/' ); 67 $this->go_to( 68 bp_members_get_user_url( 69 bp_loggedin_user_id(), 70 array( 71 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_messages', bp_get_messages_slug() ), 72 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_messages_notices', 'notices' ), 73 ) 74 ) 75 ); 38 76 $this->assertTrue( bp_is_notices() ); 39 77 }
Note: See TracChangeset
for help on using the changeset viewer.