Code Duplication    Length = 27-27 lines in 2 locations

tests/php/Forms/CheckboxSetFieldTest.php 1 location

@@ 71-97 (lines=27) @@
68
    /**
69
     * Test different data sources
70
     */
71
    public function testSources()
72
    {
73
        // Array
74
        $items = array('a' => 'Apple', 'b' => 'Banana', 'c' => 'Cranberry');
75
        $field = new CheckboxSetField('Field', null, $items);
76
        $this->assertEquals($items, $field->getSource());
77
78
        // SS_List
79
        $list = new ArrayList(
80
            array(
81
            new ArrayData(
82
                array(
83
                'ID' => 'a',
84
                'Title' => 'Apple'
85
                )
86
            ),
87
            new ArrayData(
88
                array(
89
                'ID' => 'b',
90
                'Title' => 'Banana'
91
                )
92
            ),
93
            new ArrayData(
94
                array(
95
                'ID' => 'c',
96
                'Title' => 'Cranberry'
97
                )
98
            )
99
            )
100
        );

tests/php/Forms/DropdownFieldTest.php 1 location

@@ 61-87 (lines=27) @@
58
    /**
59
     * Test different data sources
60
     */
61
    public function testSources()
62
    {
63
        // Array
64
        $items = array('a' => 'Apple', 'b' => 'Banana', 'c' => 'Cranberry');
65
        $field = new DropdownField('Field', null, $items);
66
        $this->assertEquals($items, $field->getSource());
67
68
        // SS_List
69
        $list = new ArrayList(
70
            array(
71
            new ArrayData(
72
                array(
73
                'ID' => 'a',
74
                'Title' => 'Apple'
75
                )
76
            ),
77
            new ArrayData(
78
                array(
79
                'ID' => 'b',
80
                'Title' => 'Banana'
81
                )
82
            ),
83
            new ArrayData(
84
                array(
85
                'ID' => 'c',
86
                'Title' => 'Cranberry'
87
                )
88
            )
89
            )
90
        );