From bda264bb818578dbd23f4654e697e2bf9b6dea02 Mon Sep 17 00:00:00 2001 From: Brandon Turner Date: Mon, 27 Sep 2010 10:33:01 -0500 Subject: [PATCH] [Form] Removed invalid unit test The bind() method only accepts arrays - passing objects causes an exception --- .../Component/Form/CollectionFieldTest.php | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/tests/Symfony/Tests/Component/Form/CollectionFieldTest.php b/tests/Symfony/Tests/Component/Form/CollectionFieldTest.php index b29330d40a..0add1c1ace 100644 --- a/tests/Symfony/Tests/Component/Form/CollectionFieldTest.php +++ b/tests/Symfony/Tests/Component/Form/CollectionFieldTest.php @@ -122,25 +122,4 @@ class CollectionFieldTest extends \PHPUnit_Framework_TestCase $this->assertEquals('foo@foo.com', $field[0]->getData()); $this->assertEquals('bar@bar.com', $field[1]->getData()); } - - public function testCollectionOfFieldGroupsBoundWithArrayObjectContainingObjects() - { - $fieldGroup = new FieldGroup('name'); - $fieldGroup->add(new TestField('first')); - $fieldGroup->add(new TestField('last')); - - $field = new CollectionField($fieldGroup); - - $nameData = (object) array('first' => 'Foo', 'last' => 'Bar'); - $collectionData = new \ArrayObject(array($nameData)); - $field->setData($collectionData); - - $boundNameData = (object) array('first' => 'Foo', 'last' => 'Baz'); - $boundCollectionData = new \ArrayObject(array($boundNameData)); - $field->bind($boundCollectionData); - - $this->assertTrue($field->has('0')); - $this->assertFalse($field->has('1')); - $this->assertEquals($boundNameData, $field[0]->getData()); - } }