Code Duplication    Length = 14-15 lines in 6 locations

tests/phpunit/tests/comment/query.php 6 locations

@@ 1911-1925 (lines=15) @@
1908
        $this->assertEqualSets(array_merge($c1, $c3), $found);
1909
    }
1910
1911
    public function test_post_name_single_value() 
1912
    {
1913
        $p1 = self::factory()->post->create(array( 'post_name' => 'foo' ));
1914
        $p2 = self::factory()->post->create(array( 'post_name' => 'bar' ));
1915
1916
        $c1 = self::factory()->comment->create_post_comments($p1, 1);
1917
        $c2 = self::factory()->comment->create_post_comments($p2, 1);
1918
1919
        $q = new WP_Comment_Query();
1920
        $found = $q->query(
1921
            array(
1922
            'fields' => 'ids',
1923
            'post_name' => 'bar',
1924
            ) 
1925
        );
1926
1927
        $this->assertEqualSets($c2, $found);
1928
    }
@@ 1933-1947 (lines=15) @@
1930
    /**
1931
     * @ticket 20006
1932
     */
1933
    public function test_post_name_singleton_array() 
1934
    {
1935
        $p1 = self::factory()->post->create(array( 'post_name' => 'foo' ));
1936
        $p2 = self::factory()->post->create(array( 'post_name' => 'bar' ));
1937
1938
        $c1 = self::factory()->comment->create_post_comments($p1, 1);
1939
        $c2 = self::factory()->comment->create_post_comments($p2, 1);
1940
1941
        $q = new WP_Comment_Query();
1942
        $found = $q->query(
1943
            array(
1944
            'fields' => 'ids',
1945
            'post_name' => array( 'bar' ),
1946
            ) 
1947
        );
1948
1949
        $this->assertEqualSets($c2, $found);
1950
    }
@@ 1976-1990 (lines=15) @@
1973
        $this->assertEqualSets(array_merge($c1, $c3), $found);
1974
    }
1975
1976
    public function test_post_status_single_value() 
1977
    {
1978
        $p1 = self::factory()->post->create(array( 'post_status' => 'publish' ));
1979
        $p2 = self::factory()->post->create(array( 'post_status' => 'draft' ));
1980
1981
        $c1 = self::factory()->comment->create_post_comments($p1, 1);
1982
        $c2 = self::factory()->comment->create_post_comments($p2, 1);
1983
1984
        $q = new WP_Comment_Query();
1985
        $found = $q->query(
1986
            array(
1987
            'fields' => 'ids',
1988
            'post_status' => 'draft',
1989
            ) 
1990
        );
1991
1992
        $this->assertEqualSets($c2, $found);
1993
    }
@@ 1998-2012 (lines=15) @@
1995
    /**
1996
     * @ticket 20006
1997
     */
1998
    public function test_post_status_singleton_array() 
1999
    {
2000
        $p1 = self::factory()->post->create(array( 'post_status' => 'publish' ));
2001
        $p2 = self::factory()->post->create(array( 'post_status' => 'draft' ));
2002
2003
        $c1 = self::factory()->comment->create_post_comments($p1, 1);
2004
        $c2 = self::factory()->comment->create_post_comments($p2, 1);
2005
2006
        $q = new WP_Comment_Query();
2007
        $found = $q->query(
2008
            array(
2009
            'fields' => 'ids',
2010
            'post_status' => array( 'draft' ),
2011
            ) 
2012
        );
2013
2014
        $this->assertEqualSets($c2, $found);
2015
    }
@@ 2092-2105 (lines=14) @@
2089
    /**
2090
     * @ticket 35512
2091
     */
2092
    public function test_post_status_any_should_override_other_post_statuses() 
2093
    {
2094
        $p1 = self::factory()->post->create(array( 'post_status' => 'publish' ));
2095
        $p2 = self::factory()->post->create(array( 'post_status' => 'draft' ));
2096
2097
        $c1 = self::factory()->comment->create_post_comments($p1, 1);
2098
        $c2 = self::factory()->comment->create_post_comments($p2, 1);
2099
2100
        $q = new WP_Comment_Query();
2101
        $found = $q->query(
2102
            array(
2103
            'fields' => 'ids',
2104
            'post_status' => array( 'any', 'draft' ),
2105
            ) 
2106
        );
2107
        $this->assertEqualSets(array_merge($c1, $c2), $found);
2108
    }
@@ 2113-2126 (lines=14) @@
2110
    /**
2111
     * @ticket 35512
2112
     */
2113
    public function test_post_status_any_as_part_of_an_array_of_post_statuses() 
2114
    {
2115
        $p1 = self::factory()->post->create(array( 'post_status' => 'publish' ));
2116
        $p2 = self::factory()->post->create(array( 'post_status' => 'draft' ));
2117
2118
        $c1 = self::factory()->comment->create_post_comments($p1, 1);
2119
        $c2 = self::factory()->comment->create_post_comments($p2, 1);
2120
2121
        $q = new WP_Comment_Query();
2122
        $found = $q->query(
2123
            array(
2124
            'fields' => 'ids',
2125
            'post_status' => array( 'any' ),
2126
            ) 
2127
        );
2128
        $this->assertEqualSets(array_merge($c1, $c2), $found);
2129
    }