Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | no |
Symfony version | 3.2.0 |
I open this issue, more or less a dupe of issue 23311 hopefully create some more discussion around the deprecation of Container::set() for non-synthetic services (#19192). I can't imagine a use case for Container::set() outside of testing, but in the context of testing it is very, very helpful.
My use case is testing a large application which interacts with a number of APIs via Guzzle clients (configured as services) provided by 8p/GuzzleBundle.
My test suite replaces the various Guzzle services with Guzzle MocksHandlers immediately after booting the Kernel. This lets me boot and exercise the entire application, validate outgoing requests, and creates hard errors when unexpected requests are attempted.
It seems that I'm a year late to object to this feature being removed, but for those of us that we using it it was invaluable. Is there an objection to @emil-nasso's proposed solution? Alternate configuration by itself doesn't get us very far.
I can't think of a solution to this that is close to as clean as the old way of doing it, so please correct me if I'm missing something.