Fixed incomplete EntityType tests

* testOverrideChoices
* testSetDataToUninitializedEntityWithNonRequired
This commit is contained in:
Eric Clemmons 2011-10-25 09:22:01 -07:00
parent fc97472f64
commit eca414b8b2

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());