- Issue created by @lrwebks
- π©πͺGermany Anybody Porta Westfalica
I agree, we should try to get rid of these unclear
$this->rebuildContainer();
calls that seem to be kind of a Drupal Core bug.Thank you for the documentation. This isn't important and if we find a general core issue, let's postpone this.
To see if this has been fixed upstream already, let's simply remove these calls in the MR here! :) So if the test goes green, it finally works correctly without these calls.
- π©πͺGermany Anybody Porta Westfalica
Here are some possibly related core issues, maybe someone can work through them in the future:
General search: https://www.drupal.org/project/issues/drupal?text=rebuildContainer β
- π± Use \Drupal consistently in tests Needs work
- #2252967: rebuildContainer() is not limited to web tests (WebTestBase) β
Reading through the comments in π± Use \Drupal consistently in tests Needs work and the blog entry linked above,
$this->contianer
might be the root of all evil and this issue: π± Use \Drupal consistently in tests Needs work might be the core issue to solve it? - ππΊHungary nevergone NyΓregyhΓ‘za, Hungary, Europe
rebuildContainer() is needed because after the form settings we remain in the same request and the same service container.
It's perfectly fine to use rebuildContainer(). - π©πͺGermany Anybody Porta Westfalica
Thank you very much for the helpful information @nevergone - do you have any further information regarding this? A link with details or something? Would be interesting! :)
- ππΊHungary nevergone NyΓregyhΓ‘za, Hungary, Europe
I can't provide a link, this is how I use it. I included rebuildContainer(), because otherwise, even if you set something in the form, you can't query it elsewhere.