Code Duplication    Length = 22-22 lines in 3 locations

tests/phpunit/tests/term/getTerms.php 3 locations

@@ 937-958 (lines=22) @@
934
        $this->assertEqualSets($expected, $found);
935
    }
936
937
    public function test_get_terms_hierarchical_tax_hide_empty_true_fields_ids_hierarchical_false() 
938
    {
939
        // Set up a clean taxonomy.
940
        $tax = 'hierarchical_fields';
941
        register_taxonomy($tax, 'post', array( 'hierarchical' => true ));
942
943
        $terms = $this->create_hierarchical_terms_and_posts();
944
945
        $found = get_terms(
946
            $tax, array(
947
            'hide_empty' => true,
948
            'fields' => 'ids',
949
            'hierarchical' => false,
950
            ) 
951
        );
952
953
        $expected = array(
954
         $terms['parent2'],
955
         $terms['child1'],
956
        );
957
958
        _unregister_taxonomy('hierarchical_fields');
959
960
        $this->assertEqualSets($expected, $found);
961
    }
@@ 991-1012 (lines=22) @@
988
        $this->assertEqualSets($expected, $found);
989
    }
990
991
    public function test_get_terms_hierarchical_tax_hide_empty_true_fields_names() 
992
    {
993
        // Set up a clean taxonomy.
994
        $tax = 'hierarchical_fields';
995
        register_taxonomy($tax, 'post', array( 'hierarchical' => true ));
996
997
        $terms = $this->create_hierarchical_terms_and_posts();
998
999
        $found = get_terms(
1000
            $tax, array(
1001
            'hide_empty' => true,
1002
            'fields' => 'names',
1003
            ) 
1004
        );
1005
1006
        $expected = array(
1007
         'Parent 1',
1008
         'Parent 2',
1009
         'Child 1',
1010
        );
1011
1012
        _unregister_taxonomy('hierarchical_fields');
1013
1014
        $this->assertEqualSets($expected, $found);
1015
    }
@@ 1017-1038 (lines=22) @@
1014
        $this->assertEqualSets($expected, $found);
1015
    }
1016
1017
    public function test_get_terms_hierarchical_tax_hide_empty_true_fields_names_hierarchical_false() 
1018
    {
1019
        // Set up a clean taxonomy.
1020
        $tax = 'hierarchical_fields';
1021
        register_taxonomy($tax, 'post', array( 'hierarchical' => true ));
1022
1023
        $terms = $this->create_hierarchical_terms_and_posts();
1024
1025
        $found = get_terms(
1026
            $tax, array(
1027
            'hide_empty' => true,
1028
            'fields' => 'names',
1029
            'hierarchical' => false,
1030
            ) 
1031
        );
1032
1033
        $expected = array(
1034
         'Parent 2',
1035
         'Child 1',
1036
        );
1037
1038
        _unregister_taxonomy('hierarchical_fields');
1039
1040
        $this->assertEqualSets($expected, $found);
1041
    }