19declare(strict_types=1);
21use PHPUnit\Framework\MockObject\MockObject;
24use PHPUnit\Framework\TestCase;
54 protected function setUp(): void
57 if (!defined(
'ILIAS_HTTP_PATH')) {
58 define(
'ILIAS_HTTP_PATH',
'https://ilias.de/');
60 if (!defined(
'CLIENT_ID')) {
61 define(
'CLIENT_ID',
'client');
63 if (!defined(
'SYSTEM_FOLDER_ID')) {
64 define(
'SYSTEM_FOLDER_ID', 0);
68 $provider_factory_mock = $this->createMock(ProviderFactory::class);
69 $gs_mock =
$DIC[
'global_screen'] =
new Services($provider_factory_mock);
70 $this->db_mock =
$DIC[
'ilDB'] = $this->createMock(ilDBInterface::class);
71 $this->dic_mock[
'ilUser'] =
$DIC[
'ilUser'] = $this->createMock(ilObjUser::class);
72 $this->dic_mock[
'ilSetting'] =
$DIC[
'ilSetting'] = $this->createMock(ilSetting::class);
73 $this->dic_mock[
'rbacsystem'] =
$DIC[
'rbacsystem'] = $this->createMock(ilRbacSystem::class);
74 $this->dic_mock[
'lng'] =
$DIC[
'lng'] = $this->createMock(ilLanguage::class);
75 $this->dic_mock[
'ui.factory'] =
$DIC[
'ui.factory'] = $this->createMock(Factory::class);
76 $this->dic_mock[
'ui.renderer'] =
$DIC[
'ui.renderer'] = $this->createMock(Renderer::class);
77 $this->dic_mock[
'objDefinition'] =
$DIC[
'objDefinition'] = $this->createMock(ilObjectDefinition::class);
90 $type_info =
$provider->provideTypeInformation();
91 $this->assertInstanceOf(TypeInformationCollection::class, $type_info);
94 $item_type_info = $type_info->get(TopParentItem::class);
95 $renderer = $item_type_info->getRenderer();
96 $this->assertInstanceOf(TopParentItemRenderer::class,
$renderer);
97 $this->assertInstanceOf(
103 $item_type_info = $type_info->get(Link::class);
104 $renderer = $item_type_info->getRenderer();
105 $this->assertInstanceOf(ilMMLinkItemRenderer::class,
$renderer);
106 $this->assertInstanceOf(
112 $item_type_info = $type_info->get(LinkList::class);
113 $renderer = $item_type_info->getRenderer();
114 $this->assertInstanceOf(LinkListItemRenderer::class,
$renderer);
115 $this->assertInstanceOf(
121 $item_type_info = $type_info->get(Separator::class);
122 $renderer = $item_type_info->getRenderer();
123 $this->assertInstanceOf(SeparatorItemRenderer::class,
$renderer);
124 $this->assertInstanceOf(
130 $this->dic_mock[
'ilObjDataCache'] = $this->createMock(ilObjectDataCache::class);
131 $this->dic_mock[
'static_url'] = $this->createMock(\
ILIAS\StaticURL\Services::class);
132 $item_type_info = $type_info->get(RepositoryLink::class);
133 $renderer = $item_type_info->getRenderer();
134 $this->assertInstanceOf(ilMMRepositoryLinkItemRenderer::class,
$renderer);
144 $this->dic_mock[
'lng'] = $this->createMock(ilLanguage::class);
146 $items = $standard_top_items->getStaticTopItems();
147 $item_identifications = array_map(
152 $this->assertCount(7, $items);
153 $this->assertCount(7, $item_identifications);
155 $repo = $standard_top_items->getRepositoryIdentification();
156 $this->assertContains($repo, $item_identifications);
158 $admin = $standard_top_items->getAdministrationIdentification();
159 $this->assertContains($admin, $item_identifications);
161 $achievments = $standard_top_items->getAchievementsIdentification();
162 $this->assertContains($achievments, $item_identifications);
164 $communication = $standard_top_items->getCommunicationIdentification();
165 $this->assertContains($communication, $item_identifications);
167 $organisation = $standard_top_items->getOrganisationIdentification();
168 $this->assertContains($communication, $item_identifications);
170 $personal = $standard_top_items->getPersonalWorkspaceIdentification();
171 $this->assertContains($personal, $item_identifications);
Customizing of pimple-DIC for ILIAS.
Builds a Color from either hex- or rgb values.
Class NullIdentification.
Class TypeInformationCollection.
Class LinkListItemRenderer.
Class SeparatorItemRenderer.
Class TopParentItemRenderer.
Class Link Attention: This is not the same as the \ILIAS\UI\Component\Link\Link.
Class CustomMainBarProvider.
Class StandardTopItemsProvider.
testTypeHandlers()
@noinspection PhpArrayIndexImmediatelyRewrittenInspection
Interface IdentificationInterface.
getProviderIdentification()
This describes the Combined Slate.
An entity that renders components to a string output.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.