| | 699 | * @group bp_activity_delete_comment |
| | 700 | * @group cache |
| | 701 | */ |
| | 702 | public function test_bp_activity_delete_comment_clear_cache() { |
| | 703 | // add new activity update and comment to this update |
| | 704 | $a1 = $this->factory->activity->create(); |
| | 705 | $a2 = bp_activity_new_comment( array( |
| | 706 | 'activity_id' => $a1, |
| | 707 | 'parent_id' => $a1, |
| | 708 | 'content' => 'foo', |
| | 709 | 'user_id' => 1, |
| | 710 | ) ); |
| | 711 | |
| | 712 | // prime cache |
| | 713 | bp_activity_get( array( |
| | 714 | 'in' => array( $a1 ), |
| | 715 | 'display_comments' => 'threaded', |
| | 716 | ) ); |
| | 717 | |
| | 718 | // delete activity comment |
| | 719 | bp_activity_delete_comment( $a1, $a2 ); |
| | 720 | |
| | 721 | // assert comment cache as empty for $a1 |
| | 722 | $this->assertEmpty( wp_cache_get( $a1, 'bp_activity_comments' ) ); |
| | 723 | } |
| | 724 | |
| | 725 | /** |