[TYPO3-mvc] Problems with testing Controllers (TDD)
Michael Knoll
mimi at kaktusteam.de
Fri Jan 1 22:00:10 CET 2010
Hi Sebastian,
ok - what I want to do is test each action of my controller - mainly if
it throws an error / exception or not. As the controller actions are the
heart of my application, I want to make sure, that after refactoring,
everything works fine and I want to know where to change things, if needed.
So I do not want to check the output of the controller... I think this
is rather useless. But I want to make sure that after changing anythin
in my classes, the actions work as before - do you get the idea?
So what I did now, can be found here:
http://alturl.com/apih
It would be great, if you or anybody else could take a look at it and
tell me, whether this is a good idea or not!
Greetings
Michael
Sebastian Kurfürst schrieb:
> 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