Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 59-73 (lines=15) @@
56
    /**
57
     * @ticket 12668
58
     */
59
    public function test_query_type_empty_string() 
60
    {
61
        $c1 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ));
62
        $c2 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ));
63
        $c3 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ));
64
        $c4 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ));
65
        $c5 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ));
66
67
        $q = new WP_Comment_Query();
68
        $found = $q->query(
69
            array(
70
            'type' => '',
71
            'fields' => 'ids',
72
            ) 
73
        );
74
75
        $this->assertEqualSets(array( $c1, $c2, $c3, $c4, $c5 ), $found);
76
    }
@@ 282-296 (lines=15) @@
279
    /**
280
     * @ticket 12668
281
     */
282
    public function test_type_array_comments_and_pings() 
283
    {
284
        $c1 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ));
285
        $c2 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ));
286
        $c3 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ));
287
        $c4 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ));
288
        $c5 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ));
289
290
        $q = new WP_Comment_Query();
291
        $found = $q->query(
292
            array(
293
            'type' => array( 'comments', 'pings' ),
294
            'fields' => 'ids',
295
            ) 
296
        );
297
298
        $this->assertEqualSets(array( $c1, $c2, $c3 ), $found);
299
    }