Skip to content

Commit e87fb0f

Browse files
franzwildingMarco van Angeren
authored andcommitted
[AI Bundle][VertexAI] factory get called with wrong arguments
1 parent e8e1810 commit e87fb0f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/ai-bundle/src/AiBundle.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
507507
$httpClient,
508508
new Reference('ai.platform.model_catalog.vertexai.gemini'),
509509
new Reference('ai.platform.contract.vertexai.gemini'),
510-
null,
511510
new Reference('event_dispatcher'),
512511
])
513512
->addTag('ai.platform', ['name' => 'vertexai']);

src/ai-bundle/tests/DependencyInjection/AiBundleTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747

4848
class AiBundleTest extends TestCase
4949
{
50-
#[DoesNotPerformAssertions]
5150
public function testExtensionLoadDoesNotThrow()
5251
{
5352
$container = $this->buildContainer($this->getFullConfig());
@@ -59,6 +58,15 @@ public function testExtensionLoadDoesNotThrow()
5958
$platforms = $container->findTaggedServiceIds('ai.platform');
6059

6160
foreach (array_keys($platforms) as $platformId) {
61+
$def = $container->getDefinition($platformId);
62+
$factor = $def->getFactory();
63+
64+
if (\is_array($factor)) {
65+
$ref = new \ReflectionClass($factor[0]);
66+
$numArgs = $ref->getMethod($factor[1])->getNumberOfParameters();
67+
$this->assertGreaterThanOrEqual($numArgs, \count($def->getArguments()));
68+
}
69+
6270
try {
6371
$platformService = $container->get($platformId);
6472
$platformService->getModelCatalog();

0 commit comments

Comments
 (0)