@@ -34,12 +34,12 @@ protected function createChoiceList()
3434
3535 protected function getChoices ()
3636 {
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 );
3838 }
3939
4040 protected function getValues ()
4141 {
42- return array ('0 ' , '1 ' , '2 ' , '3 ' , '4 ' , '5 ' , '6 ' , '7 ' );
42+ return array ('0 ' , '1 ' , '2 ' , '3 ' , '4 ' , '5 ' , '6 ' , '7 ' , ' 8 ' );
4343 }
4444
4545 /**
@@ -162,4 +162,13 @@ public function testGetChoicesForValuesWithContainingEmptyStringAndBooleans()
162162 $ this ->assertSame (array (0 => true ), $ choiceList ->getChoicesForValues (array ('1 ' )));
163163 $ this ->assertSame (array (0 => false ), $ choiceList ->getChoicesForValues (array ('0 ' )));
164164 }
165+
166+ public function testGetChoicesForValuesWithContainingEmptyStringAndFloats ()
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+ }
165174}
0 commit comments