Skip to content
Snippets Groups Projects
Commit 8e5e5741 authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Christian Kuhn
Browse files

[TASK] Allow private service container in tests

The private container now provides access to non-public
services that have been at least once injected (and thus
be considered as service during DI compilation phase).

This may be used to provide dependencies to functional
test setups where some dependencies needs to be mocked
while other should receive the vanilla dependency
the container would normally inject.

A functional test case does implement the ContainerInterface
now, allowing tests to access both public and private
services.

$this->getContainer() may still be used if the default
container (delivering public services only) needs to
be injected into a service.

Related testing-framework pull request:
https://github.com/TYPO3/testing-framework/pull/331

Commands executed:
  composer req --dev typo3/testing-framework:^6.16.0
  git grep -l "this->getContainer()->get("  | xargs sed -i 's/this->getContainer()->get(/this->get(/g'

Resolves: #97032
Releases: main, 11.5
Change-Id: I5987d5244270a3e190c8721f6a8971c7fd1309ef
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73732


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 18624994
Branches
Tags
No related merge requests found
Showing
with 59 additions and 58 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment