| @@ 2800-2835 (lines=36) @@ | ||
| 2797 | /** |
|
| 2798 | * @ticket 35192 |
|
| 2799 | */ |
|
| 2800 | public function test_comment_clauses_prepend_callback_should_be_respected_when_filling_descendants() |
|
| 2801 | { |
|
| 2802 | $top_level_0 = self::factory()->comment->create( |
|
| 2803 | array( |
|
| 2804 | 'comment_post_ID' => self::$post_id, |
|
| 2805 | 'comment_approved' => '1', |
|
| 2806 | ) |
|
| 2807 | ); |
|
| 2808 | ||
| 2809 | $child1_of_0 = self::factory()->comment->create( |
|
| 2810 | array( |
|
| 2811 | 'comment_post_ID' => self::$post_id, |
|
| 2812 | 'comment_approved' => '1', |
|
| 2813 | 'comment_parent' => $top_level_0, |
|
| 2814 | ) |
|
| 2815 | ); |
|
| 2816 | ||
| 2817 | $child2_of_0 = self::factory()->comment->create( |
|
| 2818 | array( |
|
| 2819 | 'comment_post_ID' => self::$post_id, |
|
| 2820 | 'comment_approved' => '1', |
|
| 2821 | 'comment_parent' => $top_level_0, |
|
| 2822 | ) |
|
| 2823 | ); |
|
| 2824 | ||
| 2825 | $top_level_comments = self::factory()->comment->create_many( |
|
| 2826 | 3, array( |
|
| 2827 | 'comment_post_ID' => self::$post_id, |
|
| 2828 | 'comment_approved' => '1', |
|
| 2829 | ) |
|
| 2830 | ); |
|
| 2831 | ||
| 2832 | $this->to_exclude = array( $child2_of_0, $top_level_comments[1] ); |
|
| 2833 | ||
| 2834 | add_filter('comments_clauses', array( $this, 'prepend_exclusions' )); |
|
| 2835 | $q = new WP_Comment_Query( |
|
| 2836 | array( |
|
| 2837 | 'post_id' => self::$post_id, |
|
| 2838 | 'hierarchical' => 'flat', |
|
| @@ 2858-2893 (lines=36) @@ | ||
| 2855 | /** |
|
| 2856 | * @ticket 35192 |
|
| 2857 | */ |
|
| 2858 | public function test_comment_clauses_append_callback_should_be_respected_when_filling_descendants() |
|
| 2859 | { |
|
| 2860 | $top_level_0 = self::factory()->comment->create( |
|
| 2861 | array( |
|
| 2862 | 'comment_post_ID' => self::$post_id, |
|
| 2863 | 'comment_approved' => '1', |
|
| 2864 | ) |
|
| 2865 | ); |
|
| 2866 | ||
| 2867 | $child1_of_0 = self::factory()->comment->create( |
|
| 2868 | array( |
|
| 2869 | 'comment_post_ID' => self::$post_id, |
|
| 2870 | 'comment_approved' => '1', |
|
| 2871 | 'comment_parent' => $top_level_0, |
|
| 2872 | ) |
|
| 2873 | ); |
|
| 2874 | ||
| 2875 | $child2_of_0 = self::factory()->comment->create( |
|
| 2876 | array( |
|
| 2877 | 'comment_post_ID' => self::$post_id, |
|
| 2878 | 'comment_approved' => '1', |
|
| 2879 | 'comment_parent' => $top_level_0, |
|
| 2880 | ) |
|
| 2881 | ); |
|
| 2882 | ||
| 2883 | $top_level_comments = self::factory()->comment->create_many( |
|
| 2884 | 3, array( |
|
| 2885 | 'comment_post_ID' => self::$post_id, |
|
| 2886 | 'comment_approved' => '1', |
|
| 2887 | ) |
|
| 2888 | ); |
|
| 2889 | ||
| 2890 | $this->to_exclude = array( $child2_of_0, $top_level_comments[1] ); |
|
| 2891 | ||
| 2892 | add_filter('comments_clauses', array( $this, 'append_exclusions' )); |
|
| 2893 | $q = new WP_Comment_Query( |
|
| 2894 | array( |
|
| 2895 | 'post_id' => self::$post_id, |
|
| 2896 | 'hierarchical' => 'flat', |
|