l10n = $this->createMock(IL10N::class); $this->templateManager = Server::get(ITemplateManager::class); $this->initialState = $this->createMock(IInitialState::class); $this->admin = new Admin( $this->l10n, $this->templateManager, $this->initialState, ); } public function testGetForm(): void { $prefixes = ['s01']; $hosts = ['s01' => '']; $wControls = $this->templateManager->getTemplate('user_ldap', 'part.wizardcontrols'); $wControls = $wControls->fetchPage(); $sControls = $this->templateManager->getTemplate('user_ldap', 'part.settingcontrols'); $sControls = $sControls->fetchPage(); $parameters = []; // assign default values $config = new Configuration('', false); $defaults = $config->getDefaults(); foreach ($defaults as $key => $default) { $parameters[$key . '_default'] = $default; } $expected = new TemplateResponse('user_ldap', 'settings', $parameters); $this->assertEquals($expected, $this->admin->getForm()); } public function testGetSection(): void { $this->assertSame('ldap', $this->admin->getSection()); } public function testGetPriority(): void { $this->assertSame(5, $this->admin->getPriority()); } }