Changeset 13433 for trunk/tests/phpunit/testcases/routing/members.php
- Timestamp:
- 03/07/2023 04:28:08 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/routing/members.php
r13431 r13433 6 6 class BP_Tests_Routing_Members extends BP_UnitTestCase { 7 7 protected $old_current_user = 0; 8 protected $permalink_structure = ''; 8 9 9 10 public function set_up() { … … 12 13 buddypress()->members->types = array(); 13 14 $this->old_current_user = get_current_user_id(); 15 $this->permalink_structure = get_option( 'permalink_structure', '' ); 14 16 $this->set_current_user( self::factory()->user->create( array( 'user_login' => 'paulgibbs', 'role' => 'subscriber' ) ) ); 15 17 } … … 17 19 public function tear_down() { 18 20 $this->set_current_user( $this->old_current_user ); 21 $this->set_permalink_structure( $this->permalink_structure ); 19 22 parent::tear_down(); 20 23 } 21 24 22 25 function test_members_directory() { 26 $this->set_permalink_structure( '/%postname%/' ); 23 27 $this->go_to( bp_get_members_directory_permalink() ); 24 28 … … 30 34 31 35 function test_member_permalink() { 32 $this->go_to( bp_core_get_user_domain( bp_loggedin_user_id() ) ); 36 $this->set_permalink_structure( '/%postname%/' ); 37 $this->go_to( bp_members_get_user_url( bp_loggedin_user_id() ) ); 33 38 $this->assertTrue( bp_is_my_profile() ); 34 39 } … … 39 44 */ 40 45 public function test_member_directory_with_member_type() { 46 $this->set_permalink_structure( '/%postname%/' ); 41 47 bp_register_member_type( 'foo' ); 42 48 $this->go_to( bp_get_members_directory_permalink() . 'type/foo/' ); … … 49 55 */ 50 56 public function test_member_directory_with_member_type_should_obey_filtered_type_slug() { 57 $this->set_permalink_structure( '/%postname%/' ); 51 58 bp_register_member_type( 'foo' ); 52 59 … … 66 73 */ 67 74 public function test_member_directory_with_member_type_that_has_custom_directory_slug() { 75 $this->set_permalink_structure( '/%postname%/' ); 68 76 bp_register_member_type( 'foo', array( 'has_directory' => 'foos' ) ); 69 77 $this->go_to( bp_get_members_directory_permalink() . 'type/foos/' ); … … 76 84 */ 77 85 public function test_member_directory_with_member_type_should_be_overridden_by_member_with_same_nicename() { 86 $this->set_permalink_structure( '/%postname%/' ); 78 87 $u = self::factory()->user->create( array( 'user_nicename' => 'foo' ) ); 79 88 bp_register_member_type( 'foo' ); … … 91 100 */ 92 101 public function test_member_directory_should_404_for_member_types_that_have_no_directory() { 102 $this->set_permalink_structure( '/%postname%/' ); 93 103 bp_register_member_type( 'foo', array( 'has_directory' => false ) ); 94 104 $this->go_to( bp_get_members_directory_permalink() . 'type/foo/' ); … … 100 110 */ 101 111 function test_members_shortlink_redirector() { 112 $this->set_permalink_structure( '/%postname%/' ); 102 113 $shortlink_member_slug = 'me'; 103 114
Note: See TracChangeset
for help on using the changeset viewer.