From 707be077359cacb29e962e775fea85f040a02def Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 3 Apr 2022 12:18:24 +0200 Subject: [PATCH] Make mocked services non-lazy (#25) This will avoid problems like > A method by name setProxyInitializer already exists in this class. --- .../CompilerPass/ProxyServiceWithMockPass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DependencyInjection/CompilerPass/ProxyServiceWithMockPass.php b/src/DependencyInjection/CompilerPass/ProxyServiceWithMockPass.php index dfb05b4..e889c12 100644 --- a/src/DependencyInjection/CompilerPass/ProxyServiceWithMockPass.php +++ b/src/DependencyInjection/CompilerPass/ProxyServiceWithMockPass.php @@ -45,7 +45,7 @@ public function process(ContainerBuilder $container) $proxy = $factory->createProxy($definition->getClass(), $initializer); $definition->setClass($proxyClass = get_class($proxy)); $definition->setPublic(true); - $definition->setLazy(true); + $definition->setLazy(false); if (null !== $definition->getFactory()) { $factoryMethod = $definition->getFactory();