Exemplo n.º 1
0
 public function testUpdateFromObjectPassesObjectThroughIfPropertyPathIsEmpty()
 {
     $object = new Author();
     $object->firstName = 'Bernhard';
     $field = new TestField('firstName', array('property_path' => null));
     $field->updateFromObject($object);
     $this->assertEquals($object, $field->getData());
 }
Exemplo n.º 2
0
 public function testUpdateFromObjectThrowsExceptionIfPropertyDoesNotExist()
 {
     $field = new TestField('foobar');
     $this->setExpectedException('Symfony\\Component\\Form\\Exception\\InvalidPropertyException');
     $field->updateFromObject(new Author());
 }