function setUp() { parent::setUp(); require_once dirname(__FILE__) . '/factory.php'; $this->factory->doc = new BP_Docs_UnitTest_Factory_For_Doc($this->factory); $this->old_current_user = get_current_user_id(); }
public function setUp() { parent::setUp(); buddypress()->members->types = array(); $this->old_current_user = get_current_user_id(); $this->set_current_user($this->factory->user->create(array('user_login' => 'paulgibbs', 'role' => 'subscriber'))); }
function setUp() { parent::setUp(); require_once dirname(__FILE__) . '/factory.php'; $this->factory->doc = new BP_Docs_UnitTest_Factory_For_Doc($this->factory); $this->old_current_user = get_current_user_id(); $this->set_current_user($this->factory->user->create(array('role' => 'subscriber'))); }
public function setUp() { parent::setUp(); add_filter('bp_attachment_upload_overrides', array($this, 'filter_overrides'), 10, 1); add_filter('upload_dir', array($this, 'filter_upload_dir'), 20, 1); $this->upload_results = array(); $this->image_file = trailingslashit(buddypress()->plugin_dir) . 'bp-core/images/mystery-man.jpg'; }
public function setUp() { parent::setUp(); $this->custom_post_types = array('using_old_filter'); register_post_type('using_old_filter', array('label' => 'using_old_filter', 'public' => true, 'supports' => array('comments'))); add_filter('bp_blogs_record_post_post_types', array($this, 'filter_post_types'), 10, 1); add_filter('bp_blogs_record_comment_post_types', array($this, 'filter_post_types'), 10, 1); }
public function setUp() { parent::setUp(); $this->current_user = bp_loggedin_user_id(); $this->set_current_user(0); if (isset($GLOBALS['groups_template'])) { $this->groups_template = $GLOBALS['groups_template']; } }
public function setUp() { parent::setUp(); $this->current_user = get_current_user_id(); $this->set_current_user($this->factory->user->create()); $this->requesting_user_id = $this->factory->user->create(); $this->group = $this->factory->group->create(); $this->filter_fired = ''; }
public function setUp() { parent::setUp(); add_filter('bp_core_enable_root_profiles', '__return_true'); $this->old_current_user = get_current_user_id(); $uid = $this->factory->user->create(array('user_login' => 'boone', 'user_nicename' => 'boone')); $this->u = new WP_User($uid); $this->set_current_user($uid); }
public function setUp() { parent::setUp(); bp_register_member_type('foo'); bp_register_member_type('bar'); $this->field_group_id = $this->factory->xprofile_group->create(); $this->field_id = $this->factory->xprofile_field->create(array('field_group_id' => $this->field_group_id)); $this->field = new BP_XProfile_Field($this->field_id); }
public function setUp() { if (is_multisite()) { $this->signup_allowed = get_site_option('registration'); update_site_option('registration', 'all'); } else { bp_get_option('users_can_register'); bp_update_option('users_can_register', 1); } parent::setUp(); }
public function setUp() { parent::setUp(); $this->_wp_http_referer = ''; $this->http_referer = ''; if (isset($_REQUEST['_wp_http_referer'])) { $this->_wp_http_referer = $_REQUEST['_wp_http_referer']; } if (isset($_SERVER['HTTP_REFERER'])) { $this->http_referer = $_SERVER['HTTP_REFERER']; } }
public function setUp() { parent::setUp(); $this->old_current_user = get_current_user_id(); $this->set_current_user($this->factory->user->create(array('role' => 'administrator'))); if (!function_exists('bp_admin')) { require_once BP_PLUGIN_DIR . 'bp-core/bp-core-admin.php'; } if (!function_exists('bp_new_site')) { bp_admin(); } }
public function setUp() { parent::setUp(); if (isset($_SERVER['HTTP_HOST'])) { $this->http_host = $_SERVER['HTTP_HOST']; } if (isset($_SERVER['SERVER_PORT'])) { $this->server_port = $_SERVER['SERVER_PORT']; } if (isset($_SERVER['REQUEST_URI'])) { $this->request_uri = $_SERVER['REQUEST_URI']; } }
public function setUp() { parent::setUp(); $this->current_user = get_current_user_id(); $this->u1 = $this->factory->user->create(); $this->u2 = $this->factory->user->create(); $this->set_current_user($this->u1); /** * Tests suite in WP < 4.0 does not include the WP_UnitTestCase->_restore_hooks() function * When updating an activity, the following filter is fired to prevent sending more than one * notification. Once we've reached this filter all at_mentions tests fails so we need to * temporarly remove it and restore it in $this->tearDown() */ remove_filter('bp_activity_at_name_do_notifications', '__return_false'); }
public function setUp() { parent::setUp(); $this->set_current_user(self::$current_user); }
public function setUp() { parent::setUp(); $this->old_current_user = get_current_user_id(); $this->set_current_user($this->factory->user->create(array('role' => 'subscriber'))); }
public function setUp() { parent::setUp(); $this->filter_fired = ''; }
public function setUp() { parent::setUp(); $this->bp_nav = buddypress()->bp_nav; $this->bp_options_nav = buddypress()->bp_options_nav; }
public function setUp() { parent::setUp(); groups_remove_member(self::$user, self::$groups[2]); }
public function setUp() { parent::setUp(); $this->u1 = $this->factory->user->create(array('display_name' => 'Unit Test', 'user_email' => '*****@*****.**')); }
public function setUp() { parent::setUp(); $this->factory = new BuddyDrive_UnitTest_Factory(); }
public function setUp() { parent::setUp(); buddypress()->members->types = array(); }