| [ Index ] |
PHP Cross Reference of BuddyPress |
[Source view] [Print] [Project Stats]
(no description)
| File Size: | 419 lines (12 kb) |
| Included or required: | 1 time |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
BP_UnitTestCase:: (25 methods):
setUpBeforeClass()
setUp()
tearDown()
delete_user()
clean_up_global_scope()
factory()
reset_bp_activity_actions()
reset_bp_activity_post_types_globals()
assertPreConditions()
go_to()
set_current_user()
add_user_to_group()
grant_super_admin()
restore_admins()
grant_bp_moderate()
revoke_bp_moderate()
grant_bp_moderate_cb()
go_to_root()
setUp_wp_mail()
tearDown_wp_mail()
commit_transaction()
rrmdir()
set_autocommit_flag()
deactivate_component()
fake_attachment_upload()
Class: BP_UnitTestCase - X-Ref
| setUpBeforeClass() X-Ref |
| Cribbed from WP so that the self::factory() call comes from this class. since: 3.0.0 |
| setUp() X-Ref |
| No description |
| tearDown() X-Ref |
| No description |
| delete_user( $user_id ) X-Ref |
| Multisite-agnostic way to delete a user from the database. since: 3.0.0 |
| clean_up_global_scope() X-Ref |
| No description |
| factory() X-Ref |
| Returns a factory that can be used across tests, even in static methods. return: BP_UnitTest_Factory since: 3.0 |
| reset_bp_activity_actions() X-Ref |
| No description |
| reset_bp_activity_post_types_globals() X-Ref |
| No description |
| assertPreConditions() X-Ref |
| No description |
| go_to( $url ) X-Ref |
| No description |
| set_current_user( $user_id ) X-Ref |
| 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 |
| add_user_to_group( $user_id, $group_id, $args = array() X-Ref |
| No description |
| grant_super_admin( $user_id ) X-Ref |
| 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 |
| restore_admins() X-Ref |
| No description |
| grant_bp_moderate( $user_id ) X-Ref |
| No description |
| revoke_bp_moderate( $user_id ) X-Ref |
| No description |
| grant_bp_moderate_cb( $retval, $capability ) X-Ref |
| No description |
| go_to_root() X-Ref |
| Go to the root blog. This helps reset globals after moving between blogs. |
| setUp_wp_mail( $args ) X-Ref |
| Set up globals necessary to avoid errors when using wp_mail() |
| tearDown_wp_mail( $args ) X-Ref |
| Tear down globals set up in setUp_wp_mail() |
| commit_transaction() X-Ref |
| Commit a MySQL transaction. |
| rrmdir( $dir ) X-Ref |
| Clean up created directories/files |
| set_autocommit_flag() X-Ref |
| Set a flag that an autocommit has taken place inside of a test method. since: 2.4.0 |
| deactivate_component( $component ) X-Ref |
| Deactivate a component for the duration of a test. since: 2.4.0 param: string $component Component name. |
| fake_attachment_upload( $file, $parent = 0 ) X-Ref |
| Fake an attachment upload (doesn't actually upload a file). return: int Attachment post ID. param: string $file Absolute path to valid file. param: int $parent Optional. Post ID to attach the new post to. |
| Generated: Thu Nov 6 01:00:59 2025 | Cross-referenced by PHPXref 0.7.1 |