[TYPO3-mvc] UnitTests for Controller

dennis ahrens dennis.ahrens at googlemail.com
Wed Nov 25 14:52:31 CET 2009


Hi list,

can anybody gimme a hint how to write a UnitTest for Controllers?

When i try to make an instance of the controller i got the following error-msg:

Error in test case exampleTest in file
/home/dahrens/t3/TYPO3_core_svn/typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.phpon
line 115:
Message:
PHP Catchable Fatal Error: Argument 1 passed to
Tx_Extbase_Persistence_Mapper_DataMapper::injectReflectionService()
must be an instance of Tx_Extbase_Reflection_Service, null given,
called in /home/dahrens/t3/TYPO3_core_svn/typo3/sysext/extbase/Classes/Dispatcher.php
on line 257 and defined in
/home/dahrens/t3/TYPO3_core_svn/typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php
line 115

The TestCode looks like this:
<?php
class Tx_BlogExample_Controller_BlogController_testcase extends
Tx_Extbase_BaseTestCase {
	/**
	 * @test
	 */
	public function exampleTest() {
		$controller = new Tx_BlogExample_Controller_BlogController();
	}
	
}
?>

regards

dennis


More information about the TYPO3-project-typo3v4mvc mailing list