Skip to content

Commit ad8e989

Browse files
committed
[Form] fixed EntityType test with query_builder option
1 parent 7d6e9b2 commit ad8e989

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,13 @@ public function testConfigureQueryBuilderWithClosureReturningNonQueryBuilder()
222222
$field->submit('2');
223223
}
224224

225-
public function testConfigureQueryBuilderWithClosureReturningNull()
225+
public function testConfigureQueryBuilderWithClosureReturningNullUseDefault()
226226
{
227+
$entity1 = new SingleIntIdEntity(1, 'Foo');
228+
$entity2 = new SingleIntIdEntity(2, 'Bar');
229+
230+
$this->persist(array($entity1, $entity2));
231+
227232
$field = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
228233
'em' => 'default',
229234
'class' => self::SINGLE_IDENT_CLASS,
@@ -232,7 +237,7 @@ public function testConfigureQueryBuilderWithClosureReturningNull()
232237
},
233238
));
234239

235-
$this->assertEquals(array(), $field->createView()->vars['choices']);
240+
$this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']);
236241
}
237242

238243
public function testSetDataSingleNull()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy