Tests for bbPress forum visibility functions.

group forums
group functions
group visibility
package bbPress
inherited_from \BBP_UnitTestCase

 Methods

assertPreConditions()

assertPreConditions() 
Inherited

clean_up_global_scope()

clean_up_global_scope() 
Inherited

Commit a MySQL transaction.

commit_transaction() 
InheritedStatic

go_to()

go_to($url) 
Inherited

Parameters

$url

We can't use grant_super_admin() because we will need to modify the list more than once, and grant_super_admin() can only be run once because of its global check

grant_super_admin($user_id) 
Inherited

Parameters

$user_id

We assume that the global can be wiped out

restore_admins() 
Inherited
see

setUp()

setUp() 
Inherited

Fake WP mail globals, to avoid errors

setUpBeforeClass() 
InheritedStatic

Set up globals necessary to avoid errors when using wp_mail()

setUp_wp_mail($args) 
InheritedStatic

Parameters

$args

WP's core tests use wp_set_current_user() to change the current user during tests. BP caches the current user differently, so we have to do a bit more work to change it

set_current_user($user_id) 
InheritedStatic

Parameters

$user_id

tearDown()

tearDown() 
Inherited

Tear down globals set up in setUp_wp_mail()

tearDown_wp_mail($args) 
InheritedStatic

Parameters

$args

test_bbp_forum_enforce_hidden()

test_bbp_forum_enforce_hidden() 
covers
todo Implement test_bbp_forum_enforce_hidden().

test_bbp_forum_enforce_private()

test_bbp_forum_enforce_private() 
covers
todo Implement test_bbp_forum_enforce_private().

test_bbp_forum_visibility_posts_where_filter()

test_bbp_forum_visibility_posts_where_filter() 
covers

test_bbp_forum_visibility_where_fails_closed_without_forum_meta()

test_bbp_forum_visibility_where_fails_closed_without_forum_meta() 
covers

test_bbp_forum_visibility_where_for_user_with_access()

test_bbp_forum_visibility_where_for_user_with_access() 
covers

test_bbp_forum_visibility_where_preserves_custom_post_types()

test_bbp_forum_visibility_where_preserves_custom_post_types() 
covers

test_bbp_forum_visibility_where_with_any_post_type()

test_bbp_forum_visibility_where_with_any_post_type() 
covers
covers

test_bbp_forum_visibility_where_with_implicit_search_post_types()

test_bbp_forum_visibility_where_with_implicit_search_post_types() 
covers
covers

test_bbp_forum_visibility_where_without_protected_forums()

test_bbp_forum_visibility_where_without_protected_forums() 
covers

test_bbp_get_excluded_forum_ids_ignores_non_countable_descendants()

test_bbp_get_excluded_forum_ids_ignores_non_countable_descendants() 
covers

test_bbp_get_excluded_forum_ids_includes_public_descendants_of_hidden_forum()

test_bbp_get_excluded_forum_ids_includes_public_descendants_of_hidden_forum() 
covers

test_bbp_get_excluded_forum_ids_includes_public_descendants_of_private_forum()

test_bbp_get_excluded_forum_ids_includes_public_descendants_of_private_forum() 
covers

test_bbp_get_forum_visibilities()

test_bbp_get_forum_visibilities() 
covers
todo Implement test_bbp_get_forum_visibilities().

test_bbp_get_hidden_forum_ids()

test_bbp_get_hidden_forum_ids() 
covers
todo Implement test_bbp_get_hidden_forum_ids().

test_bbp_get_private_forum_ids()

test_bbp_get_private_forum_ids() 
covers
todo Implement test_bbp_get_private_forum_ids().

test_bbp_pre_get_posts_normalize_forum_visibility()

test_bbp_pre_get_posts_normalize_forum_visibility() 
covers

test_bbp_pre_get_posts_normalize_forum_visibility_ignores_non_bbp_post_types()

test_bbp_pre_get_posts_normalize_forum_visibility_ignores_non_bbp_post_types() 
covers

test_bbp_pre_get_posts_normalize_forum_visibility_with_mixed_forums_topics_and_posts()

test_bbp_pre_get_posts_normalize_forum_visibility_with_mixed_forums_topics_and_posts() 
covers
covers

test_bbp_pre_get_posts_normalize_forum_visibility_with_mixed_post_types()

test_bbp_pre_get_posts_normalize_forum_visibility_with_mixed_post_types() 
covers
covers

test_bbp_pre_get_posts_normalize_forum_visibility_with_suppressed_filters()

test_bbp_pre_get_posts_normalize_forum_visibility_with_suppressed_filters() 
covers

test_bbp_repair_forum_visibility()

test_bbp_repair_forum_visibility() 
covers
todo Implement test_bbp_repair_forum_visibility().

test_descendant_forum_moderator_can_read_descendant_of_hidden_parent()

test_descendant_forum_moderator_can_read_descendant_of_hidden_parent() 
covers
covers

test_explicit_forum_id_query_excludes_restricted_forums()

test_explicit_forum_id_query_excludes_restricted_forums() 
covers

test_explicit_forum_id_query_includes_readable_forums()

test_explicit_forum_id_query_includes_readable_forums() 
covers

test_filtered_forum_moderator_is_removed_from_excluded_forums()

test_filtered_forum_moderator_is_removed_from_excluded_forums() 
covers

test_keymaster_can_read_public_descendants_of_hidden_forum()

test_keymaster_can_read_public_descendants_of_hidden_forum() 
covers

test_parent_forum_moderator_can_read_public_descendants_of_hidden_forum()

test_parent_forum_moderator_can_read_public_descendants_of_hidden_forum() 
covers
covers

test_participant_can_read_public_descendants_of_private_forum()

test_participant_can_read_public_descendants_of_private_forum() 
covers

test_participant_cannot_read_public_descendants_of_hidden_forum()

test_participant_cannot_read_public_descendants_of_hidden_forum() 
covers

test_public_forum_tree_remains_readable()

test_public_forum_tree_remains_readable() 
covers
covers

test_query_excludes_content_in_public_descendants_of_hidden_forum()

test_query_excludes_content_in_public_descendants_of_hidden_forum() 
covers
covers
covers

test_query_excludes_content_in_public_descendants_of_private_forum()

test_query_excludes_content_in_public_descendants_of_private_forum() 
covers
covers
covers

test_query_includes_descendant_content_for_parent_forum_moderator()

test_query_includes_descendant_content_for_parent_forum_moderator() 
covers
covers
covers

Create a restricted forum with public descendants and content.

create_inherited_visibility_test_posts(string $status = 'hidden') : array<mixed,integer>

Parameters

$status

string

Parent forum status.

Returns

array<mixed,integer>Forum, topic, and reply IDs.

Create public, private, and hidden forum content for visibility tests.

create_visibility_test_posts() : array<mixed,integer>

Returns

array<mixed,integer>Forum, topic, and reply IDs keyed by visibility.

 Properties

 

$cached_SERVER_NAME

$cached_SERVER_NAME 

Default

null
Static