Changeset 13433 for trunk/tests/phpunit/testcases/members/template.php
- Timestamp:
- 03/07/2023 04:28:08 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/members/template.php
r12791 r13433 4 4 */ 5 5 class BP_Tests_Members_Template extends BP_UnitTestCase { 6 protected $permalink_structure = ''; 7 8 public function set_up() { 9 parent::set_up(); 10 $this->permalink_structure = get_option( 'permalink_structure', '' ); 11 } 12 13 public function tear_down() { 14 $this->set_permalink_structure( $this->permalink_structure ); 15 16 parent::tear_down(); 17 } 18 6 19 public function test_bp_has_members_include_on_user_page() { 7 20 $u1 = self::factory()->user->create(); 8 21 $u2 = self::factory()->user->create(); 9 10 $this->go_to( bp_core_get_user_domain( $u1 ) ); 22 $this->set_permalink_structure( '/%postname%/' ); 23 24 $this->go_to( bp_members_get_user_url( $u1 ) ); 11 25 12 26 global $members_template; … … 59 73 $old_user = get_current_user_id(); 60 74 $this->set_current_user( $u2 ); 61 62 $this->go_to( bp_core_get_user_domain( $u2 ) . bp_get_friends_slug() . '/requests/' ); 75 $this->set_permalink_structure( '/%postname%/' ); 76 77 $this->go_to( 78 bp_members_get_user_url( 79 $u2, 80 array( 81 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_friends', bp_get_friends_slug() ), 82 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_friends_requests', 'requests' ), 83 ) 84 ) 85 ); 63 86 $this->restore_admins(); 64 87 … … 86 109 $old_user = get_current_user_id(); 87 110 $this->set_current_user( $u2 ); 111 $this->set_permalink_structure( '/%postname%/' ); 88 112 89 113 // For some reason, in all the user switching, the cache gets … … 93 117 wp_cache_delete( 'bp_user_domain_' . $u2, 'bp' ); 94 118 95 $this->go_to( bp_core_get_user_domain( $u2 ) . bp_get_friends_slug() . '/requests/' ); 119 $this->go_to( 120 bp_members_get_user_url( 121 $u2, 122 array( 123 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_friends', bp_get_friends_slug() ), 124 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_friends_requests', 'requests' ), 125 ) 126 ) 127 ); 96 128 $this->restore_admins(); 97 129
Note: See TracChangeset
for help on using the changeset viewer.