Changeset 9280 for trunk/tests/phpunit/testcases/blogs/functions.php
- Timestamp:
- 12/24/2014 09:26:41 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/blogs/functions.php
r9194 r9280 278 278 bp_blogs_add_blogmeta( 1, 'foo', 'bar' ); 279 279 $this->assertNotEmpty( bp_blogs_add_blogmeta( 1, 'foo', 'baz' ) ); 280 } 281 282 /** 283 * @group bp_blogs_restore_data 284 */ 285 public function test_bp_blogs_restore_data() { 286 if ( ! is_multisite() ) { 287 return; 288 } 289 290 // Create a regular member 291 $u = $this->factory->user->create(); 292 293 // Create blogs 294 $b1 = $this->factory->blog->create( array( 'user_id' => $u ) ); 295 $b2 = $this->factory->blog->create( array( 'user_id' => $u ) ); 296 297 $expected = array( 298 $b1 => $b1, 299 $b2 => $b2 300 ); 301 302 // Mark the user as spam 303 bp_core_process_spammer_status( $u, 'spam' ); 304 305 // get all blogs for user 306 $blogs = bp_blogs_get_blogs_for_user( $u, true ); 307 $blog_ids = wp_list_pluck( $blogs['blogs'], 'blog_id' ); 308 309 $this->assertNotEquals( $expected, array_map( 'intval', $blog_ids ), 'User marked as spam should not have any blog registered' ); 310 311 // Ham the user 312 bp_core_process_spammer_status( $u, 'ham' ); 313 314 // get all blogs for user 315 $blogs = bp_blogs_get_blogs_for_user( $u, true ); 316 $blog_ids = wp_list_pluck( $blogs['blogs'], 'blog_id' ); 317 318 $this->assertEquals( $expected, array_map( 'intval', $blog_ids ) ); 280 319 } 281 320
Note: See TracChangeset
for help on using the changeset viewer.