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

Michael Knoll mimi at kaktusteam.de
Fri Jan 1 05:04:21 CET 2010


Hi there!

First of all: Happy new year to all of you! I wish you all the best for 
2010 - may all your wishes come true :-)


Now - I stumbled through the following problem as I was trying to write 
testcases for my controllers. What I want to achieve is, that I can run 
every action of a controller with a kind of a minimal setup and request 
parameters to check whether all actions are working even if I did any 
refactoring.

So what I did was putting all the required configuration (TS) into an 
array, pass it to the Dispatcher and call dispatch('', $configuration)

Now comes the problem. As PHPUnit is called in the backend, TYPO3_MODE 
is set to BE. So there is no chance to get the FE configuration and test 
the controller in FE setup. Wouldn't it be nice, to somehow have the 
possibility to "inject" the inveronment in testing-situations? I don't 
see a chance to do that at the moment.

Even worse, I think that the dispatcher crashes, if there is no page UID 
available on which it runs, if it's running in FE-Mode. Am I right there?

Do you have a running solution for testing controllers via testcases or 
what would you suggest me to do?

Thanks for your help!

Greetings

Michael


More information about the TYPO3-project-typo3v4mvc mailing list