Review main Merged

44137[TASK] Avoid redundant condition blocking arrays as form object

Claus Due CR +2 V +2 Easy +28 −5 updated 11/14/15, 16:42

Commit message

Values of arrays (if formObject) can now be accessed with
property paths e.g. "key1.vars.special"

Review

  • Code review CR +2
    • Andreas Kienast +2
    • Oliver Eglseder +1
  • Verified V +2
    • Andreas Kienast +2
    • Oliver Eglseder +1

Issues 1

Files 2

Review log 18

  1. Claus Due uploaded patch set 1 10/18/15, 00:09

  2. Claus Due uploaded patch set 2 10/18/15, 18:26

  3. Mathias Brodala commented on patch set 2 10/19/15, 08:23

    Could you add a unit test with a multi-dimensional value?
  4. Stefan Neufeind commented on patch set 2 CR +1 10/20/15, 04:56

    ack. Looked up details about ObjectAccess::getPropertyPath().
  5. Claus Due commented on patch set 2 10/24/15, 16:54

    > Could you add a unit test with a multi-dimensional value? Theoretically, yes - but formally that would be testing a unit belonging to ObjectAccess::getPropertyPath which already has its own test for accessing multidimensional properties. IMHO this is not something we should be testing in this unit.
  6. Claus Due uploaded patch set 3 10/24/15, 16:56

  7. Claus Due commented on patch set 3 10/24/15, 16:56

    Rebased
  8. Stefan Neufeind commented on patch set 3 CR +1 10/25/15, 18:57

    ack, same behaviour is done in ObjectAccess::getPropertyInternal(). So it is redundant here as Claus wrote.
  9. Mathias Brodala commented on patch set 3 10/26/15, 08:08

    I was thinking about a test which ensures there's no regression in the future but you are right that the new behavior is already covered.
  10. Frank Nägler commented on patch set 3 CR +1 10/26/15, 08:25

    on reading +1 looks like it make sense. But can we add some unit tests for this method? The current tests does not contains any tests for the getPropertyValue method.
  11. Andreas Kienast voted on patch set 3 CR +1 10/26/15, 09:06

  12. Oliver Hader commented on patch set 3 CR +1 10/26/15, 13:30

    Unit tests would be great here, especially to document the new behavior on accessing an array with the property name "some.property" which is considered as segment in a nested structure now instead of the current direct index-access $array['some.property'].
  13. Tymoteusz Motylewski commented on patch set 3 11/14/15, 11:07

    Claus, It looks like a nice improvement. Do you have any code example or test extension to ease up testing?
  14. Claus Due commented on patch set 3 11/14/15, 11:57

    @Tymoteusz I'm a little stuck between the wishes of commenters in this thread and the actual situation: the unit we would be testing is not part of this class and is already thoroughly tested in the ObjectAccessorTest. TBH I don't see this as needing a unit test. The other units involved are already tested and this change is about *removing* code that wasn't tested before, either.
  15. Oliver Eglseder uploaded patch set 4 11/14/15, 12:47

  16. Oliver Eglseder commented on patch set 4 CR +1 V +1 11/14/15, 12:51

    I agree with Oliver Hader and Mathias Brodala, therefore i've added the test, that will fail without this patch to prevent regression.
  17. Andreas Kienast voted on patch set 4 CR +2 V +2 11/14/15, 16:42

  18. Gerrit merged patch set 4 11/14/15, 16:42