Review main Merged

43231[BUGFIX] Improve test class detection in ClassLoadingInformationGenerator

Nicole Hummel CR -1 V +2 Normal +41 −39 updated 09/13/15, 16:07

Commit message

Currently class names ending with test or fixture suffix are excluded
from the autoload classmap generation. Unfortunately this skips valid
class names like Tx_RedirectTest_Domain_Model_Test as well. This patch
improves the decision if class name can be skipped by assuming there is
an alphabetic character in front of the suffix.

Furthermore generation of the class map is skipped if a valid psr-4
annotation is found in the package information.

Review

  • Code review CR -1
    • Nicole Hummel +2
    • Loek Hilgersom -1
    • Mathias Brodala +1
    • Helmut Hummel +1
  • Verified V +2
    • Nicole Hummel +2
    • Mathias Brodala +1
    • Helmut Hummel +1

Issues 1

Files 2

Review log 21

  1. Nicole Hummel uploaded patch set 1 09/12/15, 09:54

  2. Helmut Hummel voted on patch set 1 CR +1 09/12/15, 10:09

  3. Mathias Brodala commented on patch set 1 CR -1 09/12/15, 10:49

    ClassLoadingInformationGenerator.php:105

    Needs strtolower()
  4. Mathias Brodala voted on patch set 1 CR 0 09/12/15, 10:54

  5. Mathias Brodala commented on patch set 1 09/12/15, 10:55

    ClassLoadingInformationGenerator.php:105 Reply

    No it doesn't, see "i" modifier.
  6. Mathias Brodala voted on patch set 1 CR +1 09/12/15, 12:25

  7. Loek Hilgersom updated the commit message in patch set 2 09/13/15, 12:43

  8. Loek Hilgersom commented on patch set 2 09/13/15, 12:51

    For testing I created 4 class files with the following names: getLatest.php, getLaTest.php, getLost.php, get_test.php In the old situation, only getLost.php gets loaded. In the new situation, getLost.php and get_test.php are loaded. Shouldn't getLatest.php also get loaded? It's quite well possible that words end with ...test, it would avoid classes mysteriously not being loaded. What'd you think?
  9. Mathias Brodala commented on patch set 2 09/13/15, 12:56

    I agree. Maybe it's safer to check for "\\tests\\" within the FQCN instead?
  10. Nicole Hummel uploaded patch set 3 09/13/15, 13:36

  11. Nicole Hummel commented on patch set 3 09/13/15, 13:37

    We do not know if we have a class name with namespaces. I added more tests and changed the regular expression slightly. IMHO using the psr-4 option in composer.json or ext_emconf.php should be the way to go!
  12. Mathias Brodala uploaded patch set 4 09/13/15, 14:29

  13. Mathias Brodala commented on patch set 4 09/13/15, 14:29

    Added class name from commit message, slightly cleaned up test code.
  14. Helmut Hummel commented on patch set 4 09/13/15, 15:23

    ClassLoadingInformationGenerator.php:105

    that ucfirst does not make sense. we can specify the correct string above instead
  15. Nicole Hummel uploaded patch set 5 09/13/15, 15:48

  16. Helmut Hummel uploaded patch set 6 09/13/15, 15:57

  17. Helmut Hummel voted on patch set 6 CR +1 V +1 09/13/15, 15:57

  18. Mathias Brodala voted on patch set 6 V +1 CR +1 09/13/15, 16:03

  19. Nicole Hummel voted on patch set 6 CR +2 V +2 09/13/15, 16:05

  20. Loek Hilgersom commented on patch set 6 CR -1 09/13/15, 16:05

    Sorry, I believe the [A-Za-z] was correct, it could also be two capitals following eachother. 1 more round?
  21. Nicole Hummel merged patch set 6 09/13/15, 16:07