[TYPO3-dev] Unit tests and method visibility

Francois Suter fsuter at cobweb.ch
Mon Jul 6 09:57:27 CEST 2009


Hi,

> Nice, 3 people all telling basically the same story :)

Yes :-) Well thanks to all!

I have read in the meantime that protected and private method should not 
normally be tested as they represent inner workings of the class. I can 
understand this argument, but I don't think that it makes sense in all 
cases.

TYPO3 is a collaborative development by a lot of people (core team 
members + wider community). It may well happen that someone wants to 
optimise code written by someone else. In such a case I'm sure that 
person would be happy to find "low level" unit tests to check that even 
internal methods are not broken by changes.

A question about the suggestion that the class extends the class to 
test: as far as I could see, current TYPO3 core test all extend 
tx_phpunit_testcase. Will my test still work if I extend some other 
class instead?

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch




More information about the TYPO3-dev mailing list