File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ public function getChoicesForValues(array $values)
141141 $ choices = array ();
142142
143143 foreach ($ values as $ i => $ givenValue ) {
144- if (isset ( $ this ->choices [ $ givenValue ] )) {
144+ if (array_key_exists ( $ givenValue , $ this ->choices )) {
145145 $ choices [$ i ] = $ this ->choices [$ givenValue ];
146146 }
147147 }
Original file line number Diff line number Diff line change @@ -130,4 +130,11 @@ public function testCompareChoicesByIdentityByDefault()
130130 $ this ->assertSame (array (2 => 'value2 ' ), $ choiceList ->getValuesForChoices (array (2 => $ obj2 )));
131131 $ this ->assertSame (array (2 => 'value2 ' ), $ choiceList ->getValuesForChoices (array (2 => (object ) array ('value ' => 'value2 ' ))));
132132 }
133+
134+ public function testGetChoicesForValuesWithContainingNull ()
135+ {
136+ $ choiceList = new ArrayChoiceList (array ('Null ' => null ));
137+
138+ $ this ->assertSame (array (0 => null ), $ choiceList ->getChoicesForValues (array ('0 ' )));
139+ }
133140}
You can’t perform that action at this time.
0 commit comments