File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,7 @@ direction LR
419419 namespace AiClientNamespace.Providers {
420420 class ProviderRegistry {
421421 +registerProvider(string $className) void
422+ +getRegisteredProviderIds() string[]
422423 +hasProvider(string $idOrClassName) bool
423424 +getProviderClassName(string $id) string
424425 +isProviderConfigured(string $idOrClassName) bool
Original file line number Diff line number Diff line change @@ -113,6 +113,18 @@ public function registerProvider(string $className): void
113113 $ this ->registeredClassNames [$ className ] = true ;
114114 }
115115
116+ /**
117+ * Gets a list of all registered provider IDs.
118+ *
119+ * @since 0.1.0
120+ *
121+ * @return list<string> List of registered provider IDs.
122+ */
123+ public function getRegisteredProviderIds (): array
124+ {
125+ return array_keys ($ this ->providerClassNames );
126+ }
127+
116128 /**
117129 * Checks if a provider is registered.
118130 *
Original file line number Diff line number Diff line change @@ -66,6 +66,21 @@ public function testRegisterProviderWithNonExistentClass(): void
6666 $ this ->registry ->registerProvider ('NonExistentProvider ' );
6767 }
6868
69+ /**
70+ * Tests that getRegisteredProviderIds returns the correct provider IDs.
71+ *
72+ * @return void
73+ */
74+ public function testGetRegisteredProviderIds (): void
75+ {
76+ $ this ->registry ->registerProvider (MockProvider::class);
77+
78+ $ this ->assertEquals (['mock ' ], $ this ->registry ->getRegisteredProviderIds ());
79+
80+ // To test with multiple providers, we would need another mock provider class.
81+ // For now, this covers the basic functionality.
82+ }
83+
6984 /**
7085 * Tests hasProvider with unregistered provider.
7186 *
You can’t perform that action at this time.
0 commit comments