Skip to content

Commit 792eb3a

Browse files
committed
feature #16725 [Form] Removed useless code (webmozart)
This PR was merged into the 3.0-dev branch. Discussion ---------- [Form] Removed useless code | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 8add405 [Form] Removed useless code
2 parents 18caa57 + 71d6bb1 commit 792eb3a

File tree

1 file changed

+6
-30
lines changed

1 file changed

+6
-30
lines changed

Tests/Form/Type/EntityTypeTest.php

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -982,37 +982,13 @@ public function testLoaderCaching()
982982
'property3' => 2,
983983
));
984984

985-
$choiceList1 = $form->get('property1')->getConfig()->getOption('choice_list');
986-
$choiceList2 = $form->get('property2')->getConfig()->getOption('choice_list');
987-
$choiceList3 = $form->get('property3')->getConfig()->getOption('choice_list');
985+
$choiceLoader1 = $form->get('property1')->getConfig()->getOption('choice_loader');
986+
$choiceLoader2 = $form->get('property2')->getConfig()->getOption('choice_loader');
987+
$choiceLoader3 = $form->get('property3')->getConfig()->getOption('choice_loader');
988988

989-
$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\ChoiceListInterface', $choiceList1);
990-
$this->assertSame($choiceList1, $choiceList2);
991-
$this->assertSame($choiceList1, $choiceList3);
992-
}
993-
994-
public function testCacheChoiceLists()
995-
{
996-
$entity1 = new SingleIntIdEntity(1, 'Foo');
997-
998-
$this->persist(array($entity1));
999-
1000-
$field1 = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
1001-
'em' => 'default',
1002-
'class' => self::SINGLE_IDENT_CLASS,
1003-
'required' => false,
1004-
'choice_label' => 'name',
1005-
));
1006-
1007-
$field2 = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
1008-
'em' => 'default',
1009-
'class' => self::SINGLE_IDENT_CLASS,
1010-
'required' => false,
1011-
'choice_label' => 'name',
1012-
));
1013-
1014-
$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\ChoiceListInterface', $field1->getConfig()->getOption('choice_list'));
1015-
$this->assertSame($field1->getConfig()->getOption('choice_list'), $field2->getConfig()->getOption('choice_list'));
989+
$this->assertInstanceOf('Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface', $choiceLoader1);
990+
$this->assertSame($choiceLoader1, $choiceLoader2);
991+
$this->assertSame($choiceLoader1, $choiceLoader3);
1016992
}
1017993

1018994
protected function createRegistryMock($name, $em)

0 commit comments

Comments
 (0)