Code Duplication    Length = 10-13 lines in 3 locations

tests/phpunit/tests/media.php 2 locations

@@ 786-795 (lines=10) @@
783
    /**
784
     * @ticket 30346
785
     */
786
    function test_attachment_url_to_postid() 
787
    {
788
        $image_path = '2014/11/' . $this->img_name;
789
        $attachment_id = self::factory()->attachment->create_object(
790
            $image_path, 0, array(
791
            'post_mime_type' => 'image/jpeg',
792
            'post_type'      => 'attachment',
793
            ) 
794
        );
795
796
        $image_url  = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $image_path;
797
        $this->assertEquals($attachment_id, attachment_url_to_postid($image_url));
798
    }
@@ 800-812 (lines=13) @@
797
        $this->assertEquals($attachment_id, attachment_url_to_postid($image_url));
798
    }
799
800
    function test_attachment_url_to_postid_schemes() 
801
    {
802
        $image_path = '2014/11/' . $this->img_name;
803
        $attachment_id = self::factory()->attachment->create_object(
804
            $image_path, 0, array(
805
            'post_mime_type' => 'image/jpeg',
806
            'post_type'      => 'attachment',
807
            ) 
808
        );
809
810
        /**
811
         * @ticket 33109 Testing protocols not matching
812
         */
813
        $image_url  = 'https://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . $image_path;
814
        $this->assertEquals($attachment_id, attachment_url_to_postid($image_url));
815
    }

tests/phpunit/tests/term/getEditTermLink.php 1 location

@@ 15-24 (lines=10) @@
12
        register_taxonomy('wptests_tax', 'post');
13
    }
14
15
    public function test_get_edit_term_link_default() 
16
    {
17
        $term1 = self::factory()->term->create(
18
            array(
19
            'taxonomy' => 'wptests_tax',
20
            'name' => 'foo',
21
            ) 
22
        );
23
24
        $actual = get_edit_term_link($term1, 'wptests_tax');
25
        $expected = 'http://' . WP_TESTS_DOMAIN . '/wp-admin/term.php?taxonomy=wptests_tax&tag_ID=' . $term1 . '&post_type=post';
26
        $this->assertEquals($expected, $actual);
27
    }