#67468Get rid of eval() in unit tests
Description
There are a number of unit tests that use eval() to extend the ‘class under test’ and open protected method by setting them to public in order to test a certain method directly that is otherwise not accessible from the outside. This is usually done for static classes.
Using eval() is rather ugly. The patch from issue #67113 picks one of these evals() and moves it to a fixture file instead. The patch can be used as an example on how to get rid of these eval() calls. As a benefit, tests will be more easy to read, debug and understand.
Other places can be found by looking for calls to eval() in unit test class files.
This issue could be used as an umbrella issue and was written for the Paris sprint. Specific patches for single file changes can be added to own issues that are related or child of this one here.
Reviews 12
- main 42321[TASK] Removes eval() in core tree dataprovider unit test
- main 40290[TASK] Removes eval() in ArrayUtilityTest
- main 40444[TASK] Removes eval() in array utility unit tests
- main 40324[TASK] Removes eval() in uri builder unit tests
- main 40425[TASK] Removes eval() in core tree data provider factory unit tests
- main 40450[TASK] Removes eval() in core data handler unit tests
- main 40446[TASK] Removes eval() in core general utility unit tests
- main 40435[TASK] Removes eval() in core path utility unit tests
- main 40448[TASK] Removes eval() in core mailer unit test
- main 40431[TASK] Removes eval() in core version number utility unit tests
- main 40288[TASK] Removes eval() in abstract backend unit tests
- main 40278[TASK] Removes eval() in scheduler unit tests
Related issues 17
- Task #67113ExtensionManagementUtilityTest
- Bug #67485eval() in scheduler tests
- Bug #67489eval() in abstract backend tests
- Bug #67490eval() in array utility tests
- Bug #67525eval() in uri builder tests
- Task #67591eval() in tree data provider test
- Task #67594eval() in version number utility test
- Task #67596eval() in path utility tests
- Task #67600eval() in general utility tests
- Bug #67601eval() in field provider test
- Task #67604eval() in mailer test
- Task #67606eval() in data handler test
- Task #67651Removes eval() in BackendUtilityTest
- Task #67664Removes eval() in Unit Tests
- Story #67665Removes eval() in extbase Unit Tests
- Task #67666Removes eval() in fluid Unit Tests
- Task #67667Removes eval() in core Unit Tests