Review main Merged

62573[TASK] Do not set GeneralUtility::$container in unit tests

Benjamin Franzke CR +2 V +2 Easy +4 −5 updated 12/06/19, 22:08

Commit message

The GeneralUtility $container instance should only be set/used
in functional tests as we a) can not reset the instance (which
means other unit tests are affected) and b) should mock/inject
dependencies in unit tests.

TreeDataProviderFactoryTest is therefore changed to to use
GeneralUtility::addInstance() (which is intended for unit tests)
instead of GeneralUtility::setContainer().

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Susi Moog +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 2

Files 1

Review log 912

  1. Benjamin Franzke uploaded patch set 1 12/06/19, 20:51

  2. TYPO3com voted on patch set 1 V +1 12/06/19, 20:59 Completed build in 08m 18s on Fri, 6 Dec, 08:59 PM Test Summary: 68741 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39217

  3. Susi Moog voted on patch set 1 V +1 CR +1 12/06/19, 21:03

  4. Susi Moog commented on patch set 1 V 0 CR -1 12/06/19, 21:06

    `GeneralUtility::addInstance(DatabaseTreeDataProvider::class, $treeDataProvider->reveal());`
  5. Benjamin Franzke uploaded patch set 2 12/06/19, 21:28

  6. TYPO3com voted on patch set 2 V -1 12/06/19, 21:29 Completed build in 25s on Fri, 6 Dec, 09:29 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39225

  7. Benjamin Franzke uploaded patch set 3 12/06/19, 21:29

  8. TYPO3com voted on patch set 3 V +1 12/06/19, 21:39 Completed build in 09m 25s on Fri, 6 Dec, 09:39 PM Test Summary: 68708 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39226

  9. Susi Moog voted on patch set 3 CR +1 12/06/19, 21:52

  10. Susi Moog voted on patch set 3 V +1 12/06/19, 22:00

  11. Andreas Kienast voted on patch set 3 V +2 CR +2 12/06/19, 22:08

  12. Andreas Kienast merged patch set 4 12/06/19, 22:08