[TYPO3-mvc] Problems with testing Controllers (TDD)

Sebastian Kurfürst sebastian at typo3.org
Fri Jan 1 11:35:19 CET 2010


Hey Michael,

A Happy New Year from my side as well :-)

I feel that you are testing too much in one run - when you run your test
cases, you will not only test the Extbase Framework again and again, but
also the model and the persistence layer.

So, what you are trying to do is not really a *Unit* Test, but an
*Integration* Test.
We don't have good support for integration tests yet, as it is very
difficult to find a "once-and-for-all" solution for such high-level
tests. We've been playing a bit with selenium for end-to-end-testing,
but that's all still quite immature.

If you *really* want to test your controllers (they should only contain
very little code) in a Unit-Test fashion, you could mock everything
around these controllers and then f.e. call the action directly, to see
if it fetches a data set from a repository (by mocking the repository),
and if it passes this to the view.

I hope this helps a bit :-)
If there is stuff unclear, don't hesitate to ask!

A Happy New Year again,
Sebastian


More information about the TYPO3-project-typo3v4mvc mailing list