merged branch ericclemmons/incomplete_entity_type_tests (PR #2538)

Commits
-------

eca414b Fixed incomplete EntityType tests

Discussion
----------

[Doctrine] [Form] (Re: #2472) Fixed incomplete EntityType tests

**Previously #2472, but rebased onto `symfony/2.0` per @fabpot's request.  See #2472 for more info**

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A
This commit is contained in:
Fabien Potencier 2011-11-02 06:50:40 +01:00
commit 067d0717cc

View File

@ -94,8 +94,6 @@ class EntityTypeTest extends TypeTestCase
public function testSetDataToUninitializedEntityWithNonRequired()
{
$this->markTestIncomplete('Needs to be implemented');
$entity1 = new SingleIdentEntity(1, 'Foo');
$entity2 = new SingleIdentEntity(2, 'Bar');
@ -108,8 +106,7 @@ class EntityTypeTest extends TypeTestCase
'property' => 'name'
));
$this->assertEquals(array('' => '', 1 => 'Foo', 2 => 'Bar'), $field->getRenderer()->getVar('choices'));
$this->assertEquals(array(1 => 'Foo', 2 => 'Bar'), $field->createView()->get('choices'));
}
/**
@ -437,8 +434,6 @@ class EntityTypeTest extends TypeTestCase
public function testOverrideChoices()
{
$this->markTestIncomplete('Fix me');
$entity1 = new SingleIdentEntity(1, 'Foo');
$entity2 = new SingleIdentEntity(2, 'Bar');
$entity3 = new SingleIdentEntity(3, 'Baz');
@ -455,7 +450,7 @@ class EntityTypeTest extends TypeTestCase
$field->bind('2');
$this->assertEquals(array(1 => 'Foo', 2 => 'Bar'), $field->getRenderer()->getVar('choices'));
$this->assertEquals(array(1 => 'Foo', 2 => 'Bar'), $field->createView()->get('choices'));
$this->assertTrue($field->isSynchronized());
$this->assertEquals($entity2, $field->getData());
$this->assertEquals(2, $field->getClientData());