8000 merged branch bschussek/issue5113-2.3 (PR #8981) · symfony/symfony@51413e1 · GitHub
[go: up one dir, main page]

Skip to content
65F1

Commit 51413e1

Browse files
committed
merged branch bschussek/issue5113-2.3 (PR #8981)
This PR was merged into the 2.3 branch. Discussion ---------- [2.3][Form] Fixed expanded choice field to be marked invalid when unknown choices are submitted Same as #7940, rebased onto 2.3. Commits ------- 7879f07 [DoctrineBridge] Improved test coverage of EntityChoiceList 58e7c10 [Form] Improved test coverage of ChoiceList classes 9542d72 [Form] Fixed expanded choice field to be marked invalid when unknown choices are submitted 72b8807 [Form] Fixed ChoiceList::get*By*() methods to preserve order and array keys e1bf07f [Form] Removed usage of the ChoiceList::getIndicesFor*() methods where they don't offer any performance benefit
2 parents eb9f76d + 7879f07 commit 51413e1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected function setUp()
5151
if (!class_exists('Doctrine\ORM\EntityManager')) {
5252
$this->markTestSkipped('Doctrine ORM is not available.');
5353
}
54-
54+
5555
$this->em = DoctrineTestHelper::createTestEntityManager();
5656

5757
$schemaTool = new SchemaTool($this->em);
@@ -110,7 +110,7 @@ public function testEntitiesMustHaveAToStringMethod()
110110
}
111111

112112
/**
113-
* @expectedException \Symfony\Component\Form\Exception\FormException
113+
* @expectedException \Symfony\Component\Form\Exception\RuntimeException
114114
*/
115115
public function testChoicesMustBeManaged()
116116
{

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
1515
use Symfony\Component\Form\Exception\UnexpectedTypeException;
16+
use Symfony\Component\Form\Test\TypeTestCase;
1617
use Symfony\Bridge\Doctrine\Tests\Fixtures\GroupableEntity;
1718
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity;
1819
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity;
@@ -22,7 +23,6 @@
2223
use Doctrine\ORM\Tools\SchemaTool;
2324
use Doctrine\Common\Collections\ArrayCollection;
2425
use Symfony\Component\Form\Extension\Core\View\ChoiceView;
25-
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
2626

2727
class EntityTypeTest extends TypeTestCase
2828
{

src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function transform($choice)
6767
}
6868

6969
if ($this->placeholderPresent) {
70-
$values['placeholder'] = false === $index;
70+
$values['placeholder'] = 0 === count($valueMap);
7171
}
7272

7373
return $values;

src/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,23 +114,23 @@ public function testSubmitWithEmptyValueUnchecked()
114114
$this->assertNull($form->getViewData());
115115
}
116116

117-
public function testBindWithEmptyValueAndFalseUnchecked()
117+
public function testSubmitWithEmptyValueAndFalseUnchecked()
118118
{
119119
$form = $this->factory->create('checkbox', null, array(
120120
'value' => '',
121121
));
122-
$form->bind(false);
122+
$form->submit(false);
123123

124124
$this->assertFalse($form->getData());
125125
$this->assertNull($form->getViewData());
126126
}
127127

128-
public function testBindWithEmptyValueAndTrueChecked()
128+
public function testSubmitWithEmptyValueAndTrueChecked()
129129
{
130130
$form = $this->factory->create('checkbox', null, array(
131131
'value' => '',
132132
));
133-
$form->bind(true);
133+
$form->submit(true);
134134

135135
$this->assertTrue($form->getData());
136136
$this->assertSame('', $form->getViewData());

0 commit comments

Comments
 (0)
0