Project

General

Profile

Actions

Bug #21676

closed

[Unit tests]: Streamline and refactor t3lib_divTest

Added by Christian Kuhn over 14 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-08-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

15382_01.diff (43.6 KB) 15382_01.diff Administrator Admin, 2010-08-07 01:09
Actions #1

Updated by Christian Kuhn over 14 years ago

  • trunk rev. 8547
  • 4.4 rev. 8548
Actions #2

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF