Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitffac441

Browse files
committed
[Form] add test for ArrayChoiceList handling null
1 parentfd33367 commitffac441

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

‎src/Symfony/Component/Form/Tests/ChoiceList/AbstractChoiceListTest.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ public function testGetValuesForChoicesEmpty()
209209
$this->assertSame(array(),$this->list->getValuesForChoices(array()));
210210
}
211211

212+
publicfunctiontestGetChoicesForValuesWithNull()
213+
{
214+
$values =$this->list->getValuesForChoices(array(null));
215+
216+
$this->assertNotEmpty($this->list->getChoicesForValues($values));
217+
}
218+
212219
/**
213220
* @return \Symfony\Component\Form\ChoiceList\ChoiceListInterface
214221
*/

‎src/Symfony/Component/Form/Tests/ChoiceList/ArrayChoiceListTest.php‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@
1818
*/
1919
class ArrayChoiceListTestextends AbstractChoiceListTest
2020
{
21-
private$object;
22-
2321
protectedfunctionsetUp()
2422
{
2523
parent::setUp();
26-
27-
$this->object =new \stdClass();
2824
}
2925

3026
protectedfunctioncreateChoiceList()
@@ -34,12 +30,12 @@ protected function createChoiceList()
3430

3531
protectedfunctiongetChoices()
3632
{
37-
returnarray(0,1,'1','a',false,true,$this->object);
33+
returnarray(0,1,'1','a',false,true,new \stdClass(),null);
3834
}
3935

4036
protectedfunctiongetValues()
4137
{
42-
returnarray('0','1','2','3','4','5','6');
38+
returnarray('0','1','2','3','4','5','6','7');
4339
}
4440

4541
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp