Feature #34

Make dependency injection for unit tests possible

Added by Karsten Dambekalns over 14 years ago. Updated about 11 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:


Dependency injection should also be possible for unit tests.


Updated by Sebastian Kurfuerst over 14 years ago

Do you have a use case for that?


Updated by Karsten Dambekalns over 14 years ago

Yes, e.g. injecting either phpCRJackrabbit_Repository or phpCRTYPO3_Repository into the phpCR unit tests.


Updated by Robert Lemke over 14 years ago

As soon as DI is possible in unit tests, we can get rid of the TYPO3->getComponentManager() method.


Updated by Robert Lemke almost 14 years ago

  • Status changed from New to Closed
  • Sprint set to fixed

(In r398) From now on all unit tests get the component manager injected (see below). Make sure to use the new
base class, then you'll find the component manager in $this->componentManager.

  • Testing: Further work on the MVC implementation of the TestRunner. Still not finished ...
  • Testing: Made an instance of the Component Manager accessible by unit tests. Test cases should now extend T3_Testing_BaseTestCase instead of PHPUnit_Framework_TestCase. Fixes #34.
  • Framework: (MVC) Added support for automatic resolution of request-type specific views (see ActionController).
  • Framework: (MVC) Made sure that the TemplateView has prototype scope.

Updated by Robert Lemke over 13 years ago

  • Target version deleted (1)

Also available in: Atom PDF