Feature #35135

Provide an inject() convenience method in Base Test Case

Added by Robert Lemke about 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
- Testing -
Start date:
2012-03-22
Due date:
% Done:

100%

PHP Version:
5.3
Has patch:
No
Complexity:
easy

Description

Testing code which uses dependency injection requires some additional lines of code for manually injecting the dependencies needed to run a unit test. This can become cumbersome in case of property injection, as reflection needs to be used in order to set a protected property.

An inject() method provided by the Base Test Case would make things a lot easier.

Associated revisions

Revision 8152b8c9 (diff)
Added by Robert Lemke about 7 years ago

[FEATURE] inject() convenience method in Base Test Case

Testing code which uses dependency injection requires
some additional lines of code for manually injecting
the dependencies needed to run a unit test.

This patch provides a new convenience method – inject() –
which takes care of manual injection of dependencies
in unit test cases.

Resolves: #35135
Releases: 1.1
Change-Id: I0f445b470dcc7acd4023b0f5ab24942326812dd8

History

#1 Updated by Gerrit Code Review about 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9870

#2 Updated by Robert Lemke about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF