public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $users = array(array('aardvark', 'Bob Smith'), array('alpaca red', 'William Quinn'), array('cat', 'Lauren Curtis'), array('caterpillar', 'Eldon Burrows'), array('dog green', 'Reece Thornton'), array('pig', 'Joshua Barton'), array('rabbit blue', 'Amber Hooper'), array('smith', 'Robert Bar'), array('snake', 'Eleanor Moore'), array('xylo', 'Silver McFadden'), array('zoom', 'Lisa Smithy'));
     $factory = new BP_UnitTest_Factory();
     // Create some dummy users.
     foreach ($users as $user_index => $user) {
         $new_user = $factory->user->create(array('display_name' => $user[1], 'user_login' => $user[0], 'user_email' => "test-{$user_index}@example.com"));
         self::$user_ids[$user[0]] = $new_user;
     }
     self::$group_slugs['hidden'] = 'the-maw';
     self::$group_slugs['public'] = 'the-great-journey';
     self::$group_slugs['private'] = 'tsavo-highway';
     // Create dummy groups.
     self::$group_ids['hidden'] = $factory->group->create(array('creator_id' => self::$user_ids['xylo'], 'slug' => self::$group_slugs['hidden'], 'status' => 'hidden'));
     self::$group_ids['public'] = $factory->group->create(array('creator_id' => self::$user_ids['xylo'], 'slug' => self::$group_slugs['public'], 'status' => 'public'));
     self::$group_ids['private'] = $factory->group->create(array('creator_id' => self::$user_ids['xylo'], 'slug' => self::$group_slugs['private'], 'status' => 'private'));
     // Add dummy users to dummy hidden groups.
     groups_join_group(self::$group_ids['hidden'], self::$user_ids['pig']);
     groups_join_group(self::$group_ids['hidden'], self::$user_ids['alpaca red']);
     // Add dummy users to dummy public groups.
     groups_join_group(self::$group_ids['public'], self::$user_ids['aardvark']);
     groups_join_group(self::$group_ids['public'], self::$user_ids['alpaca red']);
     groups_join_group(self::$group_ids['public'], self::$user_ids['cat']);
     groups_join_group(self::$group_ids['public'], self::$user_ids['smith']);
     // Add dummy users to dummy private groups.
     groups_join_group(self::$group_ids['private'], self::$user_ids['cat']);
     groups_join_group(self::$group_ids['private'], self::$user_ids['caterpillar']);
     self::commit_transaction();
 }
 public function tearDown()
 {
     parent::tearDown();
     $this->group = '';
     $this->fields = array();
     $this->users = array();
 }
Example #3
0
 public function tearDown()
 {
     $this->set_current_user($this->current_user);
     parent::tearDown();
     // Restore the filter
     add_filter('bp_activity_at_name_do_notifications', '__return_false');
 }
 public function tearDown()
 {
     parent::tearDown();
     remove_filter('bp_attachment_upload_overrides', array($this, 'filter_overrides'), 10, 1);
     remove_filter('upload_dir', array($this, 'filter_upload_dir'), 20, 1);
     $this->upload_results = array();
     $this->image_file = '';
 }
Example #5
0
 function tearDown()
 {
     parent::tearDown();
     $bp = buddypress();
     _unregister_post_type('using_old_filter');
     remove_filter('bp_blogs_record_post_post_types', array($this, 'filter_post_types'), 10);
     remove_filter('bp_blogs_record_comment_post_types', array($this, 'filter_post_types'), 10);
 }
 public function tearDown()
 {
     $this->set_current_user($this->current_user);
     if ($this->groups_template) {
         $GLOBALS['groups_template'] = $this->groups_template;
     }
     parent::tearDown();
 }
 public function tearDown()
 {
     if (is_multisite()) {
         update_site_option('registration', $this->signup_allowed);
     } else {
         bp_update_option('users_can_register', $this->signup_allowed);
     }
     parent::tearDown();
 }
 public static function tearDownAfterClass()
 {
     $emails = get_posts(array('fields' => 'ids', 'post_status' => 'any', 'post_type' => bp_get_email_post_type(), 'posts_per_page' => 200, 'suppress_filters' => false));
     if ($emails) {
         foreach ($emails as $email_id) {
             wp_delete_post($email_id, true);
         }
     }
     parent::tearDownAfterClass();
 }
 public function tearDown()
 {
     parent::tearDown();
     remove_filter('bp_attachment_upload_overrides', array($this, 'filter_overrides'), 10);
     remove_filter('upload_dir', array($this, 'filter_upload_dir'), 20);
     add_filter('bp_attachments_cover_image_upload_dir', array($this, 'filter_cover_image_dir'), 10, 2);
     $this->upload_results = array();
     $this->image_file = '';
     $this->original_upload_dir = array();
 }
Example #10
0
 function tearDown()
 {
     parent::tearDown();
     $bp = buddypress();
     _unregister_post_type('using_old_filter');
     remove_filter('bp_blogs_record_post_post_types', array($this, 'filter_post_types'), 10, 1);
     remove_filter('bp_blogs_record_comment_post_types', array($this, 'filter_post_types'), 10, 1);
     // Reset activity actions
     $bp->activity->actions = $this->activity_actions;
     $bp->activity->track = array();
 }
 public function tearDown()
 {
     if ('' !== $this->http_host) {
         $_SERVER['HTTP_HOST'] = $this->http_host;
     }
     if ('' !== $this->server_port) {
         $_SERVER['SERVER_PORT'] = $this->server_port;
     }
     if ('' !== $this->request_uri) {
         $_SERVER['REQUEST_URI'] = $this->request_uri;
     }
     parent::tearDown();
 }
 public function tearDown()
 {
     if (isset($_REQUEST['_wp_http_referer'])) {
         unset($_REQUEST['_wp_http_referer']);
     }
     if (isset($_SERVER['HTTP_REFERER'])) {
         unset($_SERVER['HTTP_REFERER']);
     }
     if ($this->_wp_http_referer) {
         $_REQUEST['_wp_http_referer'] = $this->_wp_http_referer;
     }
     if ($this->http_referer) {
         $_SERVER['HTTP_REFERER'] = $this->http_referer;
     }
     parent::tearDown();
 }
Example #13
0
 public function tearDown()
 {
     parent::tearDown();
     $dir = buddydrive()->upload_dir;
     $d = glob($dir . '/*');
     if (!empty($d)) {
         foreach ($d as $file) {
             @unlink($file);
         }
     }
     if (file_exists($dir . '/.htaccess')) {
         @unlink($dir . '/.htaccess');
     }
     if (is_dir($dir)) {
         rmdir($dir);
     }
 }
Example #14
0
 public function tearDown()
 {
     buddypress()->members->types = array();
     parent::tearDown();
 }
 public function tearDown()
 {
     buddypress()->bp_nav = $this->bp_nav;
     buddypress()->bp_options_nav = $this->bp_options_nav;
     parent::tearDown();
 }
 public function setUp()
 {
     parent::setUp();
     groups_remove_member(self::$user, self::$groups[2]);
 }
Example #17
0
 public function tearDown()
 {
     parent::tearDown();
     $this->set_current_user($this->old_current_user);
     remove_filter('bp_core_enable_root_profiles', '__return_true');
 }
Example #18
0
 public function tearDown()
 {
     parent::tearDown();
     $this->set_current_user($this->old_current_user);
 }
Example #19
0
 /**
  * Set up globals necessary to avoid errors when using wp_mail()
  */
 public static function setUp_wp_mail($args)
 {
     if (isset($_SERVER['SERVER_NAME'])) {
         self::$cached_SERVER_NAME = $_SERVER['SERVER_NAME'];
     }
     $_SERVER['SERVER_NAME'] = 'example.com';
     // passthrough
     return $args;
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::$media_extractor = new BP_Media_Extractor();
     self::$richtext = "Hello world.\n\n\t\tThis sample text is used to test the media extractor parsing class. @paulgibbs thinks it's pretty cool.\n\t\tAnother thing really cool is this @youtube:\n\n\t\thttps://www.youtube.com/watch?v=2mjvfnUAfyo\n\n\t\tThis video is literally out of the world, but uses a different protocol to the embed above:\n\n\t\thttp://www.youtube.com/watch?v=KaOC9danxNo\n\n\t\t<a href='https://example.com'>Testing a regular link.</a>\n\t\t<strong>But we should throw in some markup and maybe even an <img src='http://example.com/image.gif'>.\n\t\t<a href='http://example.com'><img src='http://example.com/image-in-a-link.gif' /></a></strong>.\n\t\tIt definitely does not like <img src='data:1234567890A'>data URIs</img>. @\n\n\t\tThe parser only extracts wp_allowed_protocols() protocols, not something like <a href='phone:004400'>phone</a>.\n\n\t\t[caption id='example']Here is a caption shortcode.[/caption]\n\n\t\tThere are two types of [gallery] shortcodes; one like that, and another with IDs specified.\n\n\t\tAudio shortcodes:\n\t\t[audio src='http://example.com/source.mp3']\n\t\t[audio src='http://example.com/source.wav' loop='on' autoplay='off' preload='metadata'].\n\n\t\tThe following shortcode should be picked up by the shortcode extractor, but not the audio extractor, because\n\t\tit has an unrecognised file extension (for an audio file). [audio src='http://example.com/not_audio.gif']\n\t\t<a href='http://example.com/more_audio.mp3'>This should be picked up, too</a>.\n\n\t\tVideo shortcodes:\n\t\t[video src='http://example.com/source.ogv']\n\t\t[video src='http://example.com/source.webm' loop='on' autoplay='off' preload='metadata']\n\n\t\tThe following shortcode should be picked up by the shortcode extractor, but not the video extractor, because\n\t\tit has an unrecognised file extension (for a video file). [video src='http://example.com/not_video.mp3']\n\t\t";
 }
Example #21
0
 /**
  * Tear down globals set up in setUp_wp_mail()
  */
 public static function tearDown_wp_mail($args)
 {
     if (!empty(self::$cached_SERVER_NAME)) {
         $_SERVER['SERVER_NAME'] = self::$cached_SERVER_NAME;
         self::$cached_SERVER_NAME = '';
     } else {
         unset($_SERVER['SERVER_NAME']);
     }
     // passthrough
     return $args;
 }
Example #22
0
 public function setUp()
 {
     parent::setUp();
     $this->filter_fired = '';
 }
 public function tearDown()
 {
     parent::tearDown();
     $this->set_current_user(self::$old_user_id);
 }
Example #24
0
 public function setUp()
 {
     parent::setUp();
     buddypress()->members->types = array();
 }
 public function setUp()
 {
     parent::setUp();
     $this->u1 = $this->factory->user->create(array('display_name' => 'Unit Test', 'user_email' => '*****@*****.**'));
 }