This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/Form
Jeremy Mikola df9ef79953 [Form] readPropertyPath should return null instead of empty array
When reading the last bit of a property path mapped to a missing array index, the method would initialize the value to an empty array.  This makes sense for cases where readPropertyPath would again be called recursively, but not when the value would be immediately returned (null would be preferable in that case).

For example, we have an object with a property called "options" that's an array of arbitrary key/value pairs.  That "options" property (and getOptions()) maps directly to a FieldGroup within the Form for this object.  That FieldGroup contains multiple TextFields for a few expected keys in the array.  As-is, if those keys were not defined, the default data set for those TextFields could end up being "Array" (string representation of an empty array).  If readPropertyPath instead returns null for this case, the default data would be transformed into an empty string.
2010-10-13 08:17:05 +02:00
..
Fixtures renamed Symfony\Components to Symfony\Component 2010-08-20 23:09:55 +02:00
ValueTransformer Refactor ValueTransformers to recieve the original value when reverseTransform() is called. This is required for expensive value transformations for example Doctrine Collections or Proxies to allow access to a value that does not trigger expensive operations (such as database calls) anymore. 2010-10-06 14:16:47 +02:00
ChoiceFieldTest.php replaced form field rendering with plain templates 2010-10-05 08:34:33 +02:00
CollectionFieldTest.php [Form] Removed invalid unit test 2010-09-27 17:54:43 +02:00
DateFieldTest.php replaced form field rendering with plain templates 2010-10-05 08:34:33 +02:00
DateTimeFieldTest.php replaced form field rendering with plain templates 2010-10-05 08:34:33 +02:00
DateTimeTestCase.php renamed Symfony\Components to Symfony\Component 2010-08-20 23:09:55 +02:00
FieldGroupTest.php [Form] Refactored logic to read and set values from Field to PropertyPath 2010-10-11 12:52:10 +02:00
FieldTest.php [Form] Refactored logic to read and set values from Field to PropertyPath 2010-10-11 12:52:10 +02:00
FormTest.php [Form] Removed CSRF setters because they have no effect once CSRF protection is enabled. Re-enable CSRF protection with the desired values instead 2010-10-11 12:52:17 +02:00
HiddenFieldTest.php replaced form field rendering with plain templates 2010-10-05 08:34:33 +02:00
IntegerFieldTest.php renamed Symfony\Components to Symfony\Component 2010-08-20 23:09:55 +02:00
LocalizedTestCase.php renamed Symfony\Components to Symfony\Component 2010-08-20 23:09:55 +02:00
PropertyPathTest.php [Form] readPropertyPath should return null instead of empty array 2010-10-13 08:17:05 +02:00
RepeatedFieldTest.php renamed Symfony\Components to Symfony\Component 2010-08-20 23:09:55 +02:00
TimeFieldTest.php replaced form field rendering with plain templates 2010-10-05 08:34:33 +02:00