TYPO3 Flow Base DistributionPackagesApplications

Feature #34

Make dependency injection for unit tests possible

Added by Karsten Dambekalns over 8 years ago. Updated almost 5 years ago.

Status:Closed Start date:
Priority:Should have Due date:
Assigned To:Robert Lemke % Done:

0%

Category:-
Target version:-

Description

Dependency injection should also be possible for unit tests.

History

#1 Updated by Sebastian Kurfuerst over 8 years ago

Do you have a use case for that?

#2 Updated by Karsten Dambekalns over 8 years ago

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

#3 Updated by Robert Lemke over 8 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 over 7 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 about 7 years ago

  • Target version deleted (1)

Also available in: Atom PDF