From 2e9a9b7c6ad8cce3d3871849aad2482408c072a5 Mon Sep 17 00:00:00 2001 From: Franz Wilding Date: Mon, 24 Nov 2025 09:28:30 +0100 Subject: [PATCH] [AI Bundle][VertexAI] factory get called with wrong arguments --- src/ai-bundle/src/AiBundle.php | 1 - .../tests/DependencyInjection/AiBundleTest.php | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ai-bundle/src/AiBundle.php b/src/ai-bundle/src/AiBundle.php index 4922e79f6..24be43ae8 100644 --- a/src/ai-bundle/src/AiBundle.php +++ b/src/ai-bundle/src/AiBundle.php @@ -507,7 +507,6 @@ private function processPlatformConfig(string $type, array $platform, ContainerB $httpClient, new Reference('ai.platform.model_catalog.vertexai.gemini'), new Reference('ai.platform.contract.vertexai.gemini'), - null, new Reference('event_dispatcher'), ]) ->addTag('ai.platform', ['name' => 'vertexai']); diff --git a/src/ai-bundle/tests/DependencyInjection/AiBundleTest.php b/src/ai-bundle/tests/DependencyInjection/AiBundleTest.php index 239ef5cc0..da1ee3ab8 100644 --- a/src/ai-bundle/tests/DependencyInjection/AiBundleTest.php +++ b/src/ai-bundle/tests/DependencyInjection/AiBundleTest.php @@ -46,7 +46,6 @@ class AiBundleTest extends TestCase { - #[DoesNotPerformAssertions] public function testExtensionLoadDoesNotThrow() { $container = $this->buildContainer($this->getFullConfig()); @@ -58,6 +57,15 @@ public function testExtensionLoadDoesNotThrow() $platforms = $container->findTaggedServiceIds('ai.platform'); foreach (array_keys($platforms) as $platformId) { + $def = $container->getDefinition($platformId); + $factor = $def->getFactory(); + + if (\is_array($factor)) { + $ref = new \ReflectionClass($factor[0]); + $numArgs = $ref->getMethod($factor[1])->getNumberOfParameters(); + $this->assertGreaterThanOrEqual($numArgs, \count($def->getArguments())); + } + try { $platformService = $container->get($platformId); $platformService->getModelCatalog();