Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 1104-1122 (lines=19) @@
1101
    /**
1102
     * @ticket 29885
1103
     */
1104
    function test_fields_post_author__in() 
1105
    {
1106
        $author_id1 = 105;
1107
        $author_id2 = 106;
1108
1109
        $p1 = self::factory()->post->create(array( 'post_author' => $author_id1    ));
1110
        $p2 = self::factory()->post->create(array( 'post_author' => $author_id1    ));
1111
        $p3 = self::factory()->post->create(array( 'post_author' => $author_id2    ));
1112
1113
        $c1 = self::factory()->comment->create(array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ));
1114
        $c2 = self::factory()->comment->create(array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ));
1115
        $c3 = self::factory()->comment->create(array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ));
1116
1117
        $comment_ids = get_comments(
1118
            array(
1119
            'fields' => 'ids',
1120
            'post_author__in' => array( $author_id1 ),
1121
            ) 
1122
        );
1123
1124
        $this->assertEqualSets(array( $c1, $c2 ), $comment_ids);
1125
    }
@@ 1130-1148 (lines=19) @@
1127
    /**
1128
     * @ticket 29885
1129
     */
1130
    function test_fields_post_author__not_in() 
1131
    {
1132
        $author_id1 = 111;
1133
        $author_id2 = 112;
1134
1135
        $p1 = self::factory()->post->create(array( 'post_author' => $author_id1    ));
1136
        $p2 = self::factory()->post->create(array( 'post_author' => $author_id1    ));
1137
        $p3 = self::factory()->post->create(array( 'post_author' => $author_id2    ));
1138
1139
        $c1 = self::factory()->comment->create(array( 'comment_post_ID' => $p1, 'user_id' => 1, 'comment_approved' => '1' ));
1140
        $c2 = self::factory()->comment->create(array( 'comment_post_ID' => $p2, 'user_id' => 1, 'comment_approved' => '1' ));
1141
        $c3 = self::factory()->comment->create(array( 'comment_post_ID' => $p3, 'user_id' => 1, 'comment_approved' => '1' ));
1142
1143
        $comment_ids = get_comments(
1144
            array(
1145
            'fields' => 'ids',
1146
            'post_author__not_in' => array( $author_id1 ),
1147
            ) 
1148
        );
1149
1150
        $this->assertEqualSets(array( $c3 ), $comment_ids);
1151
    }