Review main Merged

76840[BUGFIX] Cover invalid type `db` input in ContentObjectRenderer->getData

Nikita Hovratov CR +2 V +2 Normal +56 −11 updated 11/28/22, 08:59

Commit message

Review

  • Code review CR +2 Done
    • Nikita Hovratov +2
    • Oliver Klee +1
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Nikita Hovratov +2
    • Oliver Klee +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2126

Show 1 earlier messages
  1. Nikita Hovratov uploaded patch set 1 11/26/22, 21:31

  1. core-ci voted on patch set 1 V +1 11/26/22, 21:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34267

  2. Stefan Bürk uploaded patch set 2 V +1 11/27/22, 05:03

  3. Stefan Bürk voted on patch set 2 V +1 CR +1 11/27/22, 05:09

  4. core-ci voted on patch set 2 V +1 11/27/22, 05:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34277

  5. Chris Müller commented on patch set 2 CR -1 11/27/22, 07:29

    ContentObjectRendererTest.php:1416

    You are checking header (which does also not exist) instead of title.
  6. Stefan Bürk commented on patch set 2 CR -1 11/27/22, 12:25

    ContentObjectRendererTest.php:1416 Reply

    Right, because it's a faked stripped down dummy record (unit test). But I would go remove the header one as the new one explicitly states that it should not exist. In real world header colum would be valid for tt_content. Will change it.
  7. Stefan Bürk uploaded patch set 3 CR -1 V +1 11/27/22, 12:35

  8. Stefan Bürk commented on patch set 3 11/27/22, 12:35

    ContentObjectRendererTest.php:1416 Reply

    Done
  9. Stefan Bürk voted on patch set 3 V +1 CR +1 11/27/22, 12:35

  10. Oliver Klee commented on patch set 2 11/27/22, 12:37

    ContentObjectRendererTest.php:1416

    Those are quite a lot of asserts for a single unit test. I propose splitting this up into multiple tests and use a data provider for the case where the result is an empty string. (Then we can also use test names that communicate a statement about the expected behavior.)
  11. core-ci voted on patch set 3 V +1 11/27/22, 12:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34280

  12. Stefan Bürk uploaded patch set 4 CR +1 V +1 11/27/22, 13:00

  13. Stefan Bürk commented on patch set 4 11/27/22, 13:00

    ContentObjectRendererTest.php:1416 Reply

    Done
  14. Stefan Bürk voted on patch set 4 V +1 CR +1 11/27/22, 13:01

  15. Chris Müller voted on patch set 4 CR +1 11/27/22, 13:05

  16. core-ci voted on patch set 4 V +1 11/27/22, 13:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34281

  17. Oliver Klee commented on patch set 4 11/27/22, 14:58

    ContentObjectRendererTest.php:1459

    We should at least split this up in two two tests: one for the success case, and one for the non-success case. Then we can also drop the $expectedValue parameter (which is a code smell in tests and can hint at a test doing too much). As far as the test names are concerned, I recommend this slide: https://speakerdeck.com/oliverklee/test-driven-development-with-phpunit-1?slide=49
  18. Stefan Bürk uploaded patch set 5 CR +1 V +1 11/27/22, 16:59

  19. core-ci voted on patch set 5 V +1 11/27/22, 17:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34284

  20. Stefan Bürk commented on patch set 5 V +1 CR +1 11/27/22, 17:11

    ContentObjectRendererTest.php:1459 Reply

    Done. Please let us now get the bugfix in. And I suggest that you adjust the test yourself directly the next time, instead of suggestion it over multiple comments. Or at least FULLY state the endresult you want in mind.
  21. Oliver Klee voted on patch set 5 V +1 11/27/22, 22:39

  22. Oliver Klee commented on patch set 5 CR +1 11/27/22, 22:41

    ContentObjectRendererTest.php:1459 Reply

    I tried to do so in my first review comment, but seems to have failed to do so spectacularly. I am sorry. I'll try to be more specific in the future.
  23. Benni Mack voted on patch set 5 CR +1 11/28/22, 08:04

  24. Nikita Hovratov voted on patch set 5 V +2 CR +2 11/28/22, 08:59

  25. Nikita Hovratov merged patch set 6 11/28/22, 08:59