Bug #21676
closed[Unit tests]: Streamline and refactor t3lib_divTest
0%
Description
The following patch will be committed in 72 hours if nobody objects.
Type: Unit test cleanup
Branches: trunk, 4.4
Problem:
While there are still a lot unit tests missing for methods of t3lib_div, it's already one the best tested classes in the core. This class could be an example for a "how to write sane tests" documentation, if we modernize and streamline some of the existing tests.
Solution:
Clean up current tests:
- Every test method name starts with the tested method name, do not start with "check", "does", etc.
- Improve naming of some methods
- Refactor some tests to use data providers
- Add missing comment blocks "test concerning xy" to improve overview
- Remove superfluous comments and annotations which are already clear by the test method name
- Minor CGL improvements
- Reduce number of tests with multiple assertions, usual goal is to have only one assertion per test
- Use "named" data providers, which show a meaningfull message
- Remove some duplicate tests
How to test:
You should get green bar feelling before and after applying the patch.
Notes:
Please do not add / change t3lib_div tests in 4.4 / trunk until this issue is solved to prevent this patch from breaking ... it was a pretty stupid task anyway and I don't want to repeat it ;)
(issue imported from #M15382)
Files