You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In config_test.yaml, I replaced service definitions with mocks. Now, a parameter binding defined in the general config.yaml is not needed anymore. Because of this, the Kernel doesn't compile and throws InvalidArgumentException: A binding is configured for an argument of type "string" named … under "_defaults" in file…, but no corresponding argument has been found. It may be unused and should be removed, or it may have a typo
It seems like I'm supposed to undo the bind in the testing config, but I can't undo yaml keys.
How to reproduce
Bind a parameter by name and/or type and use it in a service:
Symfony version(s) affected
>=3.4.0-BETA1
Description
In
config_test.yaml
, I replaced service definitions with mocks. Now, a parameter binding defined in the generalconfig.yaml
is not needed anymore. Because of this, the Kernel doesn't compile and throwsInvalidArgumentException: A binding is configured for an argument of type "string" named … under "_defaults" in file…, but no corresponding argument has been found. It may be unused and should be removed, or it may have a typo
It seems like I'm supposed to undo the bind in the testing config, but I can't undo yaml keys.
How to reproduce
Bind a parameter by name and/or type and use it in a service:
Overwrite the using service in your test config:
See the mentioned error every time you use the container in a KernelTestCase.
Possible Solution
Don't throw an exception when there are unused bindings – raise warning or info instead
Additional Context
No response
The text was updated successfully, but these errors were encountered: