Feature #34

Make dependency injection for unit tests possible

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

Status:
Closed
Priority:
Should have
Assignee:
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Dependency injection should also be possible for unit tests.

#1

Updated by Sebastian Kurfuerst over 14 years ago

Do you have a use case for that?

#2

Updated by Karsten Dambekalns over 14 years ago

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

#3

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.

#4

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.
#5

Updated by Robert Lemke over 13 years ago

  • Target version deleted (1)

Also available in: Atom PDF