Code Duplication    Length = 21-22 lines in 2 locations

tests/php/Forms/DropdownFieldTest.php 2 locations

@@ 179-199 (lines=21) @@
176
        );
177
    }
178
179
    public function testStringZeroValueSelectedOptionBehaviour()
180
    {
181
        $field = new DropdownField(
182
            'Field',
183
            null,
184
            array(
185
            '-1' => 'some negative',
186
            '0' => 'none',
187
            '1' => 'one',
188
            '2+' => 'two or more'
189
            ),
190
            '0'
191
        );
192
193
        $selectedOptions = $this->findSelectedOptionElements($field->Field());
194
        $this->assertEquals((string) $selectedOptions[0], 'none', 'The selected option is "none"');
195
196
        $field = new DropdownField(
197
            'Field',
198
            null,
199
            array(
200
            '-1' => 'some negative',
201
            '0' => 'none',
202
            '1' => 'one',
@@ 212-233 (lines=22) @@
209
        $this->assertEquals((string) $selectedOptions[0], 'none', 'The selected option is "none"');
210
    }
211
212
    public function testStringOneValueSelectedOptionBehaviour()
213
    {
214
        $field = new DropdownField(
215
            'Field',
216
            null,
217
            array(
218
            '-1' => 'some negative',
219
            '0' => 'none',
220
            '1' => 'one',
221
            '2+' => 'two or more'
222
            ),
223
            '1'
224
        );
225
226
227
        $selectedOptions = $this->findSelectedOptionElements($field->Field());
228
        $this->assertEquals((string) $selectedOptions[0], 'one', 'The selected option is "one"');
229
230
        $field = new DropdownField(
231
            'Field',
232
            null,
233
            array(
234
            '-1' => 'some negative',
235
            '0' => 'none',
236
            '1' => 'one',