diff --git a/tests/lib/Search/SearchComposerTest.php b/tests/lib/Search/SearchComposerTest.php new file mode 100644 index 00000000000..c47e86bad2b --- /dev/null +++ b/tests/lib/Search/SearchComposerTest.php @@ -0,0 +1,61 @@ +bootstrapCoordinator = $this->createMock(Coordinator::class); + $this->container = $this->createMock(ContainerInterface::class); + $this->urlGenerator = $this->createMock(IURLGenerator::class); + $this->logger = $this->createMock(LoggerInterface::class); + $this->appConfig = $this->createMock(IAppConfig::class); + + $this->searchComposer = new SearchComposer( + $this->bootstrapCoordinator, + $this->container, + $this->urlGenerator, + $this->logger, + $this->appConfig + ); + } + + private function setupEmptyRegistrationContext(): void { + $this->bootstrapCoordinator->expects($this->once()) + ->method('getRegistrationContext') + ->willReturn(null); + } + + public function testGetProvidersWithNoRegisteredProviders(): void { + $this->setupEmptyRegistrationContext(); + + $providers = $this->searchComposer->getProviders('/test/route', []); + + $this->assertIsArray($providers); + $this->assertEmpty($providers); + } +}