| 439 | * @group bp_core_process_spammer_status |
| 440 | * @group cache |
| 441 | */ |
| 442 | public function test_bp_core_process_spammer_status_should_delete_userdata_cache() { |
| 443 | $u = $this->factory->user->create(); |
| 444 | |
| 445 | // Prime the cache. |
| 446 | $q = new BP_User_Query( array( |
| 447 | 'include' => array( $u ), |
| 448 | ) ); |
| 449 | |
| 450 | $this->assertNotEmpty( wp_cache_get( 'bp_core_userdata_' . $u, 'bp' ) ); |
| 451 | |
| 452 | bp_core_process_spammer_status( $u, 'spam' ); |
| 453 | |
| 454 | $this->assertEmpty( wp_cache_get( 'bp_core_userdata_' . $u, 'bp' ) ); |
| 455 | } |
| 456 | |
| 457 | /** |
| 458 | * @group bp_core_process_spammer_status |
| 459 | * @group cache |
| 460 | */ |
| 461 | public function test_bp_core_process_spammer_status_should_delete_member_count_cache() { |
| 462 | $u = $this->factory->user->create(); |
| 463 | |
| 464 | // Prime the cache. |
| 465 | $q = new BP_User_Query( array( |
| 466 | 'include' => array( $u ), |
| 467 | ) ); |
| 468 | |
| 469 | $total_before = bp_core_get_total_member_count(); |
| 470 | $active_before = bp_core_get_active_member_count(); |
| 471 | bp_core_process_spammer_status( $u, 'spam' ); |
| 472 | |
| 473 | $this->assertEquals( $total_before - 1, bp_core_get_total_member_count() ); |
| 474 | $this->assertEquals( $active_before - 1, bp_core_get_active_member_count() ); |
| 475 | } |
| 476 | |
| 477 | /** |