From 291c35cc47ef0d9d7f762fda94e7f30c928b730e Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 30 Jul 2025 10:06:40 +0200 Subject: [PATCH] test(SearchComposerTest): add test for provider icon generation Signed-off-by: Misha M.-Kupriyanov --- tests/lib/Search/SearchComposerTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/lib/Search/SearchComposerTest.php b/tests/lib/Search/SearchComposerTest.php index 38be90c7d81..774d121308c 100644 --- a/tests/lib/Search/SearchComposerTest.php +++ b/tests/lib/Search/SearchComposerTest.php @@ -156,6 +156,22 @@ class SearchComposerTest extends TestCase { ]); } + public function testProviderIconGeneration(): void { + $providerConfigs = [ + 'provider1' => ['service' => 'provider1_service', 'appId' => 'app1', 'order' => 10], + ]; + + $mockData = $this->createMockProvidersAndRegistrations($providerConfigs); + $this->setupRegistrationContextWithProviders($mockData['registrations']); + $this->setupAppConfigForAllowedProviders(); + + $providers = $this->searchComposer->getProviders('/test/route', []); + + $this->assertCount(1, $providers); + $this->assertArrayHasKey('icon', $providers[0]); + $this->assertStringContainsString('/apps/provider1/img/provider1.svg', $providers[0]['icon']); + } + /** * Assert providers array structure and expected sorting */