Review main Merged

60426[TASK] Add unit tests for PathUtility::isAbsolutePath()

Alexander Grein CR +2 V +2 Normal +96 −10 updated 07/05/19, 16:52

Commit message

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Daniel Goerz +1
    • Daniel Windloff +1
    • Oliver Klee +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Daniel Goerz +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 3239

Show 1314 earlier messages
  1. Alexander Grein uploaded patch set 1 04/09/19, 10:13

  2. Oliver Klee commented on patch set 1 04/09/19, 10:23

    Can we have a regression test for this?
  3. TYPO3com voted on patch set 1 V +1 04/09/19, 10:30 Completed build in 17m 14s on Tue, 9 Apr, 12:30 PM Test Summary: 47267 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33131

  4. Alexander Grein commented on patch set 1 04/09/19, 10:40

    > Patch Set 1: > > Can we have a regression test for this? Sorry, I do not know how to do.
  5. Nicole Hummel commented on patch set 1 CR -1 04/09/19, 10:45

    I think this patch is wrong as the first backslash in the string is only a escaping sequence and is not counting as an own character.
  6. Andreas Kienast commented on patch set 1 04/09/19, 11:31

    Weird paths are weird: $ php -a Interactive shell php > $path = 'C:\\'; php > var_dump(substr($path, 1, 3) === ':\\'); bool(true) php > var_dump(substr($path, 1, 2) === ':\\'); bool(true)
  7. Nicole Hummel commented on patch set 1 04/09/19, 11:35

    > Patch Set 1: > > Weird paths are weird: > > $ php -a > Interactive shell > > php > $path = 'C:\\'; > php > var_dump(substr($path, 1, 3) === ':\\'); > bool(true) > php > var_dump(substr($path, 1, 2) === ':\\'); > bool(true) If you try to select 3 characters from a 2 characters long string, you only get a 2 characters string back and of course that one is equal the 2 character long string to check ;-)
  8. Andreas Kienast commented on patch set 1 04/09/19, 11:52

    > Patch Set 1: > If you try to select 3 characters from a 2 characters long string, you only get a 2 characters string back and of course that one is equal the 2 character long string to check ;-) Erm yeah, obviously. I better grab another coffee...
  9. Daniel Goerz uploaded patch set 2 04/09/19, 12:09

  10. Daniel Goerz commented on patch set 2 CR -1 04/09/19, 12:12

    Just reverted the change to substr and added tests for this method to cover all cases. Nicole is right here. Please have a look. If everybody agrees, I would adapt the Commit Message to just add the tests :) -1 for now as the commit message no longer reflects what this patch does.
  11. Daniel Goerz uploaded patch set 3 04/09/19, 12:14

  12. Daniel Goerz voted on patch set 3 CR -1 04/09/19, 12:14

  13. Daniel Goerz commented on patch set 3 04/09/19, 12:16

    @Alex: Could you elaborate for what input this method did return the wrong result for you on windows?
  14. Nicole Hummel commented on patch set 3 04/09/19, 12:23

    Not sure here, but does any other test already uses isAbsolutePath already?
  1. TYPO3com voted on patch set 2 V +1 04/09/19, 12:23 Completed build in 13m 27s on Tue, 9 Apr, 02:23 PM Test Summary: 47299 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33135

  2. Daniel Goerz commented on patch set 3 04/09/19, 12:30

    > Not sure here, but does any other test already uses isAbsolutePath > already? getCanonicalPath calls isAbsolutePath but the test always sets the environment to Windows. I think it's fine to test isAbsolutePath on its own, too.
  3. TYPO3com voted on patch set 3 V +1 04/09/19, 12:35 Completed build in 17m 10s on Tue, 9 Apr, 02:35 PM Test Summary: 47299 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33137

  4. Nicole Hummel commented on patch set 3 04/09/19, 12:37

    PathUtilityTest.php:512 Unresolved

    I would not preset the variable here and move $expectedResult either to the start or end of the parameter list
  5. Alexander Grein commented on patch set 3 04/09/19, 21:18

    > Patch Set 3: > > @Alex: Could you elaborate for what input this method did return the wrong result for you on windows? Sorry, I do not use windows. I had a discusion with benjamin kott about his bootstrap_package and the problem with extending theme extensions installed as local packages using composer. He told me that oliver hader has made a patch for it, which saddly not work under benjamins windows system. You can read the hole discussion in the bootstrap-package slack channel if you like. During checking the PathUtility::getCanonicalPath method inside oli's code (https://github.com/benjaminkott/bootstrap_package/pull/585/files) I found this "bug", which is, after the always ;-) ichhabrecht review, not a bug (ash on my main).
  6. Tobi Kretschmann commented on patch set 3 04/12/19, 08:28

    > Patch Set 3: > > > Patch Set 3: > > > > @Alex: Could you elaborate for what input this method did return the wrong result for you on windows? > > Sorry, I do not use windows. I had a discusion with benjamin kott about his bootstrap_package and the problem with extending theme extensions installed as local packages using composer. He told me that oliver hader has made a patch for it, which saddly not work under benjamins windows system. You can read the hole discussion in the bootstrap-package slack channel if you like. > During checking the PathUtility::getCanonicalPath method inside oli's code (https://github.com/benjaminkott/bootstrap_package/pull/585/files) I found this "bug", which is, after the always ;-) ichhabrecht review, not a bug (ash on my main). Just to clarify, is this a Bug that needs fixing, or can we abandon this patchset?
  7. Daniel Goerz commented on patch set 3 04/12/19, 08:37

    This is not a bug but we can add the tests (and change the Commit message and the releases accordingly). I'll take care of that on the weekend.
  8. Daniel Goerz uploaded patch set 4 04/14/19, 16:33

  9. Oliver Klee commented on patch set 5 04/14/19, 16:38

    Published edit on patch set 4.
  10. TYPO3com voted on patch set 4 V +1 04/14/19, 16:50 Completed build in 17m 15s on Sun, 14 Apr, 06:50 PM Test Summary: 47489 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33259

  11. TYPO3com voted on patch set 5 V +1 04/14/19, 16:52 Completed build in 14m 52s on Sun, 14 Apr, 06:52 PM Test Summary: 47489 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33260

  12. Anja Leichsenring commented on patch set 5 05/19/19, 07:05

    as the class is open anyway, would you add the strict-types declaration and not only annotate the input types, but rather put them into the functions parameter list? Also, @return array[] looks rather invalid.
  13. Oliver Klee commented on patch set 5 05/19/19, 08:37

    "@return array[]" is syntactically valid. It means "a nested array of any type" and is the same as "mixed[][]". I haven't checked whether the annotation matches what the method returns, though.
  14. Oliver Klee commented on patch set 6 05/19/19, 16:49

    Published edit on patch set 5.
  15. Oliver Klee commented on patch set 6 05/19/19, 16:49

    Done.
  16. TYPO3com voted on patch set 6 V +1 05/19/19, 17:03 Completed build in 14m 07s on Sun, 19 May, 07:03 PM Test Summary: 46537 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33930

  17. Oliver Klee voted on patch set 6 CR +1 05/19/19, 18:31

  18. Anja Leichsenring commented on patch set 6 CR -1 05/19/19, 19:42

    strict types declaration missing
  19. Oliver Klee commented on patch set 7 05/19/19, 20:27

    Published edit on patch set 6.
  20. TYPO3com voted on patch set 7 V +1 05/19/19, 20:41 Completed build in 13m 53s on Sun, 19 May, 10:41 PM Test Summary: 46537 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33931

  21. Oliver Klee voted on patch set 7 CR +1 05/20/19, 09:35

  22. Daniel Goerz voted on patch set 7 V +1 CR +1 06/28/19, 16:05

  23. Daniel Windloff voted on patch set 7 CR +1 07/05/19, 16:50

  24. Anja Leichsenring voted on patch set 7 V +2 CR +2 07/05/19, 16:52

  25. Anja Leichsenring merged patch set 8 07/05/19, 16:52