Review main Merged

76194[TASK] Convert FormRuntimeTest to a functional test

Elias Häußler CR +2 V +2 Hard +142 −130 updated 10/21/22, 22:32

Commit message

The FormRuntimeTest is converted from unit test to a functional test.
This avoids heavy mocking and makes the test cases more realistic.
Additionally, the `$container` parameter in `FormRuntime` is now
marked as `readonly`.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1114

  1. Elias Häußler uploaded patch set 1 10/20/22, 11:44

  2. Elias Häußler uploaded patch set 2 10/20/22, 11:47

  3. Oliver Klee commented on patch set 2 10/20/22, 11:54

    FormRuntimeTest.php:37

    Can we skip the DB in this testcase (to speed things up), or do we need it?
  4. core-ci voted on patch set 2 V +1 10/20/22, 11:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32506

  5. core-ci voted on patch set 1 V +1 10/20/22, 11:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32505

  6. Elias Häußler commented on patch set 2 10/20/22, 12:20

    FormRuntimeTest.php:37 Reply

    It seems like the ConfigurationManager needs a DB. At least I'm getting an exception when setting `$initializeDatabase = false` and was able to track it down to `BackendConfigurationManager::getCurrentPageIdFromCurrentSiteRoot()`.
  7. Oliver Klee commented on patch set 2 10/20/22, 12:33

    FormRuntimeTest.php:37 Reply

    Ack
  8. Christian Kuhn commented on patch set 2 10/21/22, 22:13

    FormRuntimeTest.php:59

    globals are backed up. it should be possible to remove this.
  9. Christian Kuhn uploaded patch set 3 10/21/22, 22:15

  10. Christian Kuhn commented on patch set 3 10/21/22, 22:17

    FormRuntimeTest.php:52

    it would be an even better strategy to perform an actual FE request here. However, since the two existing tests only test for exceptions, the fake FE enviroment is ok for now over issues a executeFrontendSubRequest() instead.
  11. core-ci voted on patch set 3 V +1 10/21/22, 22:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32607

  12. Christian Kuhn voted on patch set 3 V +1 CR +1 10/21/22, 22:31

  13. Stefan Bürk voted on patch set 3 V +2 CR +2 10/21/22, 22:32

  14. Stefan Bürk merged patch set 4 10/21/22, 22:32