Changeset 13468 for trunk/tests/phpunit/testcases/routing/groups.php
- Timestamp:
- 05/03/2023 06:18:23 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/testcases/routing/groups.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/routing/groups.php
r13449 r13468 55 55 public function test_group_directory_with_type() { 56 56 $this->set_permalink_structure( '/%postname%/' ); 57 bp_groups_register_group_type( 'foo' ); 57 bp_groups_register_group_type( 58 'foo', 59 array( 60 'has_directory' => true, 61 ) 62 ); 63 64 $url = bp_get_groups_directory_url( 65 array( 66 'directory_type' => 'foo', 67 ) 68 ); 69 70 $this->go_to( $url ); 71 72 $this->assertTrue( bp_is_groups_component() && ! bp_is_group() && bp_is_current_action( bp_get_groups_group_type_base() ) && bp_is_action_variable( 'foo', 0 ) ); 73 } 74 75 /** 76 * @group group_types 77 */ 78 public function test_group_directory_with_type_that_has_custom_directory_slug() { 79 $this->set_permalink_structure( '/%postname%/' ); 80 bp_groups_register_group_type( 'bar', array( 'has_directory' => 'bars' ) ); 81 82 $url = bp_get_groups_directory_url( 83 array( 84 'directory_type' => 'bars', 85 ) 86 ); 87 88 $this->go_to( $url ); 89 90 $this->assertTrue( bp_is_groups_component() && ! bp_is_group() && bp_is_current_action( bp_get_groups_group_type_base() ) && bp_is_action_variable( 'bars', 0 ) ); 91 } 92 93 /** 94 * @group group_types 95 */ 96 public function test_group_directory_should_404_for_group_types_that_have_no_directory() { 97 $this->set_permalink_structure( '/%postname%/' ); 98 bp_groups_register_group_type( 'taz', array( 'has_directory' => false ) ); 99 58 100 $this->go_to( 59 101 bp_get_groups_directory_url( 60 102 array( 61 'directory_type' => 'foo',62 )63 )64 );65 $this->assertTrue( bp_is_groups_component() && ! bp_is_group() && bp_is_current_action( bp_get_groups_group_type_base() ) && bp_is_action_variable( 'foo', 0 ) );66 }67 68 /**69 * @group group_types70 */71 public function test_group_directory_with_type_that_has_custom_directory_slug() {72 $this->set_permalink_structure( '/%postname%/' );73 bp_groups_register_group_type( 'foo', array( 'has_directory' => 'foos' ) );74 $this->go_to(75 bp_get_groups_directory_url(76 array(77 'directory_type' => 'foos',78 )79 )80 );81 $this->assertTrue( bp_is_groups_component() && ! bp_is_group() && bp_is_current_action( bp_get_groups_group_type_base() ) && bp_is_action_variable( 'foos', 0 ) );82 }83 84 /**85 * @group group_types86 */87 public function test_group_directory_should_404_for_group_types_that_have_no_directory() {88 $this->set_permalink_structure( '/%postname%/' );89 bp_groups_register_group_type( 'taz', array( 'has_directory' => false ) );90 $this->go_to(91 bp_get_groups_directory_url(92 array(93 103 'directory_type' => 'taz', 94 104 ) 95 105 ) 96 106 ); 107 97 108 $this->assertEmpty( bp_get_current_group_directory_type() ); 98 109 } … … 167 178 /** 168 179 * @group group_previous_slug 169 * @group imath170 180 */ 171 181 public function test_group_previous_slug_most_recent_takes_precedence() {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)