diff --git a/tests/phpunit/testcases/groups/types.php b/tests/phpunit/testcases/groups/types.php
index 6ebcd73..619606b 100644
a
|
b
|
class BP_Tests_Groups_Types extends BP_UnitTestCase { |
313 | 313 | // Assert! |
314 | 314 | $this->assertEqualSets( $types, bp_groups_get_group_type( $g, false ) ); |
315 | 315 | } |
| 316 | |
| 317 | public function test_group_directory_with_type() { |
| 318 | bp_groups_register_group_type( 'foo' ); |
| 319 | $this->go_to( bp_get_groups_directory_permalink() . 'type/foo/' ); |
| 320 | $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 ) ); |
| 321 | } |
| 322 | |
| 323 | public function test_group_directory_with_type_that_has_custom_directory_slug() { |
| 324 | bp_groups_register_group_type( 'foo', array( 'has_directory' => 'foos' ) ); |
| 325 | $this->go_to( bp_get_groups_directory_permalink() . 'type/foos/' ); |
| 326 | $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 ) ); |
| 327 | } |
| 328 | |
| 329 | public function test_group_directory_should_drop_to_main_dir_for_types_that_have_no_directory() { |
| 330 | bp_groups_register_group_type( 'foo', array( 'has_directory' => false ) ); |
| 331 | $this->go_to( bp_get_groups_directory_permalink() . 'type/foo/' ); |
| 332 | $this->assertTrue( bp_is_groups_component() && ! bp_is_group() && ! bp_current_action() ); |
| 333 | } |
| 334 | |
| 335 | public function test_group_directory_should_drop_to_main_dir_for_types_that_do_not_exist() { |
| 336 | $this->go_to( bp_get_groups_directory_permalink() . 'type/sammyg/' ); |
| 337 | $this->assertTrue( bp_is_groups_component() && ! bp_is_group() && ! bp_current_action() ); |
| 338 | } |
316 | 339 | } |