@@ -34,12 +34,12 @@ protected function createChoiceList()
34
34
35
35
protected function getChoices ()
36
36
{
37
- return array (0 , 1 , '1 ' , 'a ' , false , true , $ this ->object , null );
37
+ return array (0 , 1 , 1.5 , '1 ' , 'a ' , false , true , $ this ->object , null );
38
38
}
39
39
40
40
protected function getValues ()
41
41
{
42
- return array ('0 ' , '1 ' , '2 ' , '3 ' , '4 ' , '5 ' , '6 ' , '7 ' );
42
+ return array ('0 ' , '1 ' , '2 ' , '3 ' , '4 ' , '5 ' , '6 ' , '7 ' , ' 8 ' );
43
43
}
44
44
45
45
/**
@@ -162,4 +162,13 @@ public function testGetChoicesForValuesWithContainingEmptyStringAndBooleans()
162
162
$ this ->assertSame (array (0 => true ), $ choiceList ->getChoicesForValues (array ('1 ' )));
163
163
$ this ->assertSame (array (0 => false ), $ choiceList ->getChoicesForValues (array ('0 ' )));
164
164
}
165
+
166
+ public function testGetChoicesForValuesWithContainingEmptyStringIntegersAndFloats ()
167
+ {
168
+ $ choiceList = new ArrayChoiceList (array ('Empty String ' => '' , '1/3 ' => 0.3 , '1/2 ' => 0.5 ));
169
+
170
+ $ this ->assertSame (array (0 => '' ), $ choiceList ->getChoicesForValues (array ('' )));
171
+ $ this ->assertSame (array (0 => 0.3 ), $ choiceList ->getChoicesForValues (array ('0.3 ' )));
172
+ $ this ->assertSame (array (0 => 0.5 ), $ choiceList ->getChoicesForValues (array ('0.5 ' )));
173
+ }
165
174
}
0 commit comments