Skip to content

Commit 2e9a9b7

Browse files
franzwildingOskarStark
authored andcommitted
[AI Bundle][VertexAI] factory get called with wrong arguments
1 parent 6ed950f commit 2e9a9b7

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
@@ -46,7 +46,6 @@
4646

4747
class AiBundleTest extends TestCase
4848
{
49-
#[DoesNotPerformAssertions]
5049
public function testExtensionLoadDoesNotThrow()
5150
{
5251
$container = $this->buildContainer($this->getFullConfig());
@@ -58,6 +57,15 @@ public function testExtensionLoadDoesNotThrow()
5857
$platforms = $container->findTaggedServiceIds('ai.platform');
5958

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

0 commit comments

Comments
 (0)