Review main Merged

52378[TASK] Cover getContentObject related methods by unit tests.

Elmar Hinz CR +2 V +2 Normal +101 −10 updated 09/07/17, 07:53

Commit message

Cover getContentObject related methods of ContentObjectRenderer
by unit tests.

Review

  • Code review CR +2
    • Tymoteusz Motylewski +2
    • Oliver Klee +1
    • Anja Leichsenring +1
  • Verified V +2
    • Tymoteusz Motylewski +2
    • Anja Leichsenring +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 4357

Show 2332 earlier messages
  1. Elmar Hinz uploaded patch set 1 04/06/17, 18:14

  2. TYPO3com voted on patch set 1 V -1 04/06/17, 18:22 Completed build in 08m 15s on Thu, 6 Apr, 08:22 PM Test Summary: 56648 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10345

  3. Elmar Hinz uploaded patch set 2 04/06/17, 19:01

  4. TYPO3com voted on patch set 2 V -1 04/06/17, 19:12 Completed build in 10m 59s on Thu, 6 Apr, 09:12 PM Test Summary: 56654 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10346

  5. Elmar Hinz uploaded patch set 3 04/06/17, 19:24

  6. TYPO3com voted on patch set 3 V +1 04/06/17, 19:32 Completed build in 07m 47s on Thu, 6 Apr, 09:32 PM Test Summary: 56654 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10348

  7. Oliver Klee commented on patch set 3 04/06/17, 21:58

    contet -> Content (missing "n" and uppercase "C")
  8. Elmar Hinz updated the commit message in patch set 4 04/07/17, 00:18

  9. TYPO3com voted on patch set 4 V +1 04/07/17, 00:25 Completed build in 07m 19s on Fri, 7 Apr, 02:25 AM Test Summary: 56654 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10355

  10. Elmar Hinz commented on patch set 4 04/07/17, 08:48

    Done, but merge "Cover trivial setters and getters of cObj" before.
  11. Elmar Hinz uploaded patch set 5 04/14/17, 09:52

  12. Elmar Hinz updated the commit message in patch set 6 04/14/17, 09:52

  13. Elmar Hinz uploaded patch set 7 04/14/17, 09:54

  14. TYPO3com voted on patch set 5 V +1 04/14/17, 09:59 Completed build in 07m 40s on Fri, 14 Apr, 11:59 AM Test Summary: 56690 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10532

  15. TYPO3com voted on patch set 7 V -1 04/14/17, 10:02 Completed build in 08m 02s on Fri, 14 Apr, 12:02 PM Test Summary: 28727 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10534

  16. TYPO3com voted on patch set 6 V +1 04/14/17, 10:03 Completed build in 10m 52s on Fri, 14 Apr, 12:03 PM Test Summary: 56690 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10533

  17. Elmar Hinz rebased onto patch set 8 04/14/17, 10:05

  18. TYPO3com voted on patch set 8 V +1 04/14/17, 10:16 Completed build in 10m 38s on Fri, 14 Apr, 12:16 PM Test Summary: 56690 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10537

  19. Elmar Hinz rebased onto patch set 9 04/25/17, 22:46

  20. TYPO3com voted on patch set 9 V +1 04/25/17, 22:55 Completed build in 09m 37s on Wed, 26 Apr, 12:55 AM Test Summary: 55806 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10965

  21. Mathias Brodala commented on patch set 9 CR -1 05/04/17, 12:19

    ContentObjectRendererTest.php:254

    Could you rephrase the test methods to that they can follow the sentence "Test, that it ..."?
  22. Elmar Hinz commented on patch set 9 05/04/17, 12:25

    ContentObjectRendererTest.php:254 Reply

    While I like to name tests in sentence style, the general pattern of ContentObjectRenderTest is to name the tests like the methods they test. Should we dare to break with this pattern?
  23. Mathias Brodala commented on patch set 9 05/04/17, 12:28

    ContentObjectRendererTest.php:254 Reply

    Not sure where you are looking at but all other methods in this class follow the pattern I mentioned. Although it's not obvious due to typos. ;-)
  24. Elmar Hinz commented on patch set 9 05/04/17, 12:41

    ContentObjectRendererTest.php:254 Reply

    Some example of tests having the name of the tested method: * ContentObjectRenderTest::stdWrap_noTrimWrap * ContentObjectRenderTest::getFromCache
  25. Mathias Brodala commented on patch set 9 05/04/17, 13:02

    ContentObjectRendererTest.php:254 Reply

    OK, these should be renamed in a separate change then. In generall pretty much everything uses the mentioned style, also in TYPO3.
  26. Tymoteusz Motylewski commented on patch set 9 05/04/17, 13:03

    let's have these tests backported to other branches
  27. Oliver Klee commented on patch set 9 05/04/17, 13:09

    ContentObjectRendererTest.php:254 Reply

    Good test names read like a sentence that is a statement about the tested code. This allows a reader to check that the code in the test actually tests the right thing. Example: registerContentObjectClassRegistersObjectByName I've covered this in my slides on unit testing: https://speakerdeck.com/oliverklee/test-driven-development-mit-typo3#36
  28. Oliver Klee commented on patch set 9 05/04/17, 13:10

    ContentObjectRendererTest.php:254 Reply

  29. Elmar Hinz commented on patch set 9 05/05/17, 09:11

    ContentObjectRendererTest.php:254 Reply

    Guys, how do we proceed here? 1. Breaking the style of the class now? 2. Keeping to it and change all methods in a separate change?
  30. Mathias Brodala commented on patch set 9 05/05/17, 09:14

    ContentObjectRendererTest.php:254 Reply

    As said, please add new methods with the proper style. Fixing existing methods is a topic for a separate change.
  31. Oliver Klee commented on patch set 9 05/05/17, 09:23

    ContentObjectRendererTest.php:254 Reply

    +1
  32. Elmar Hinz uploaded patch set 10 05/05/17, 10:12

  1. TYPO3com voted on patch set 10 V +1 05/05/17, 10:18 Completed build in 05m 28s on Fri, 5 May, 12:18 PM Test Summary: 55812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11217

  2. Elmar Hinz uploaded patch set 11 05/05/17, 10:18

  3. TYPO3com voted on patch set 11 V +1 05/05/17, 10:24 Completed build in 05m 37s on Fri, 5 May, 12:24 PM Test Summary: 55812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11218

  4. Oliver Klee commented on patch set 11 CR -1 05/05/17, 10:44

    ContentObjectRendererTest.php:271

    One test should only test one thing. It looks like this test actually tests to separate things, hence it should actually be two tests.

    ContentObjectRendererTest.php:292

    This comments is not necessary.

    ContentObjectRendererTest.php:296

    Proposal for a name: getContentObjectForRegisteredContentObjectsReturnsIt

    ContentObjectRendererTest.php:302

    These should be two separate tests.

    ContentObjectRendererTest.php:308

    This comment also is not necessary. (Ideally, for small tests, the test name should be expressive enough.)

    ContentObjectRendererTest.php:312

    Proposal for a name: getContentObjectForRegisteredNonContentObjectThrowsException

    ContentObjectRendererTest.php:323

    This can be @return string[][] to help static code analysis.

    ContentObjectRendererTest.php:325

    Here, we can use the array return type hint.

    ContentObjectRendererTest.php:358

    Actually, the fact that it delegates to makeInstance is very "white-box" testing. I propose to change the name to only reflect the behavior (if that's what the test is actually is about: getContentObjectReturnsRegisteredObject (or something similar). What do you think?
  5. Elmar Hinz commented on patch set 11 05/05/17, 11:22

    ContentObjectRendererTest.php:296 Reply

    "Test, that it ..." getContentObjectForRegisteredContentObjectsReturnsIt

    ContentObjectRendererTest.php:325 Reply

    Yesterday Benni complained when doing this in a non-strict class. I tend to do it anyway for reasons of documentation and for the future.

    ContentObjectRendererTest.php:358 Reply

    The alternative is just dropping it. Everything else is tested previously.
  6. Oliver Klee commented on patch set 11 05/05/17, 12:38

    ContentObjectRendererTest.php:325 Reply

    +1

    ContentObjectRendererTest.php:358 Reply

    Hm… would this test catch bugs that the other tests won't catch? If it does, then we need this test. And if it doesn't, then we won't need it. :-)
  7. Elmar Hinz uploaded patch set 12 05/05/17, 15:11

  8. TYPO3com voted on patch set 12 V +1 05/05/17, 15:17 Completed build in 05m 38s on Fri, 5 May, 05:17 PM Test Summary: 55812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11234

  9. Oliver Klee commented on patch set 12 CR +1 05/05/17, 15:29

    Neat!
  10. Elmar Hinz uploaded patch set 13 05/05/17, 15:38

  11. TYPO3com voted on patch set 13 V +1 05/05/17, 15:44 Completed build in 05m 24s on Fri, 5 May, 05:44 PM Test Summary: 55812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11237

  12. Oliver Klee voted on patch set 13 CR +1 05/05/17, 15:44

  13. Tymoteusz Motylewski updated the commit message in patch set 14 05/06/17, 10:12

  14. Tymoteusz Motylewski commented on patch set 14 05/06/17, 10:13

    let's backport tests to older branches too
  15. TYPO3com voted on patch set 14 V +1 05/06/17, 10:18 Completed build in 05m 55s on Sat, 6 May, 12:18 PM Test Summary: 55812 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11247

  16. Oliver Klee voted on patch set 14 CR +1 05/06/17, 10:45

  17. Elmar Hinz voted on patch set 14 CR +1 05/06/17, 12:07

  18. Oliver Klee commented on patch set 14 05/06/17, 13:07

    Um, Elmar, you cannot vote on your own change requests.
  19. Elmar Hinz commented on patch set 14 CR 0 05/06/17, 13:10

    Hmm, did work somehow. I intended to confirm Tymoteusz updates.
  20. Tymoteusz Motylewski voted on patch set 14 CR +1 V +1 05/06/17, 15:26

  21. Anja Leichsenring commented on patch set 14 CR +1 V +1 05/11/17, 12:12

    Voting on own changes, when someone else worked on it too, is completely fine.
  22. Tymoteusz Motylewski voted on patch set 14 CR +2 V +2 05/11/17, 12:13

  23. Gerrit merged patch set 14 05/11/17, 12:13

  24. Tymoteusz Motylewski commented on patch set 15 05/11/17, 12:14

    Cherry Picked This patchset was cherry picked to branch TYPO3_8-7 as commit 920f16ed98024da2c206bba08854f5049f738e9a
  25. Stephan Großberndt commented on patch set 15 09/07/17, 07:53

    Backport to 7.6 is missing