diff --git a/src/Service/FormAnnotationBuilderFactory.php b/src/Service/FormAnnotationBuilderFactory.php index 9e749696e..cb81c652b 100644 --- a/src/Service/FormAnnotationBuilderFactory.php +++ b/src/Service/FormAnnotationBuilderFactory.php @@ -96,7 +96,7 @@ private function injectFactory( AnnotationBuilder $annotationBuilder ) { if ($formElementManager instanceof FormElementManagerV2Polyfill) { - $formElementManager->injectFactory($annotationBuilder, $container); + $formElementManager->injectFactory($annotationBuilder, $formElementManager); return; } diff --git a/test/Service/FormAnnotationBuilderFactoryTest.php b/test/Service/FormAnnotationBuilderFactoryTest.php index 733ada671..2059e61e2 100644 --- a/test/Service/FormAnnotationBuilderFactoryTest.php +++ b/test/Service/FormAnnotationBuilderFactoryTest.php @@ -62,7 +62,7 @@ public function testInjectFactoryInCorrectOrderV2() ->method('injectFactory') ->with($this->callback(function ($annotationBuilder) { return $annotationBuilder instanceof AnnotationBuilder; - }), $serviceLocator); + }), $mockElementManager); $sut = new FormAnnotationBuilderFactory(); $sut->createService($serviceLocator);