[TYPO3-core] RFC: #11836: Remove final from classes

Bastian Waidelich bastian at typo3.org
Tue Sep 1 10:15:32 CEST 2009


Martin Kutschker wrote:

Hi Masi & co,

> I stumbled into the same problem, but I don't like Steffens approach to
> "extend" a static class.

I agree, "eval is evil" ;)
But: In the last days I stumbled upon the problem, that we have lots of 
dependencies in the core classes that are impossible to mock in unit 
tests. Even if you only want to test a single method - if this creates a 
new instance using t3lib_div::makeInstance, there are actually three 
classes involved.
In short: having the possibility to mock t3lib_dib in phpunit 
environment would be a great help to ease and stabilize unit tests (not 
only for core classes).


> Better would be to fade out these static classes and create singletons
> instead.

Absolutely!

Bastian


More information about the TYPO3-team-core mailing list