|
@@ 812-826 (lines=15) @@
|
| 809 |
|
$this->assertSame('trash', $comment->comment_approved); |
| 810 |
|
} |
| 811 |
|
|
| 812 |
|
public function test_untrash_should_invalidate_comment_cache() |
| 813 |
|
{ |
| 814 |
|
global $wpdb; |
| 815 |
|
|
| 816 |
|
$c = self::factory()->comment->create(); |
| 817 |
|
wp_trash_comment($c); |
| 818 |
|
|
| 819 |
|
$comment = get_comment($c); |
| 820 |
|
$this->assertSame('trash', $comment->comment_approved); |
| 821 |
|
|
| 822 |
|
wp_untrash_comment($c); |
| 823 |
|
|
| 824 |
|
$comment = get_comment($c); |
| 825 |
|
|
| 826 |
|
$this->assertSame('1', $comment->comment_approved); |
| 827 |
|
} |
| 828 |
|
|
| 829 |
|
public function test_spam_should_invalidate_comment_cache() |
|
@@ 844-858 (lines=15) @@
|
| 841 |
|
$this->assertSame('spam', $comment->comment_approved); |
| 842 |
|
} |
| 843 |
|
|
| 844 |
|
public function test_unspam_should_invalidate_comment_cache() |
| 845 |
|
{ |
| 846 |
|
global $wpdb; |
| 847 |
|
|
| 848 |
|
$c = self::factory()->comment->create(); |
| 849 |
|
wp_spam_comment($c); |
| 850 |
|
|
| 851 |
|
$comment = get_comment($c); |
| 852 |
|
$this->assertSame('spam', $comment->comment_approved); |
| 853 |
|
|
| 854 |
|
wp_unspam_comment($c); |
| 855 |
|
|
| 856 |
|
$comment = get_comment($c); |
| 857 |
|
|
| 858 |
|
$this->assertSame('1', $comment->comment_approved); |
| 859 |
|
} |
| 860 |
|
} |
| 861 |
|
|