ILIAS
trunk Revision v12.0_alpha-1540-g00f839d5fa1
◀ ilDoc Overview
ilKSDocumentationEntryGUITest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
require_once(
'vendor/composer/vendor/autoload.php'
);
22
include_once(
'./components/ILIAS/UI/tests/UITestHelper.php'
);
23
24
use PHPUnit\Framework\TestCase;
25
use
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntries
as Entries;
26
use
ILIAS\UI\Implementation\Component\Panel\Report
;
27
28
class
ilKSDocumentationEntryGUITest
extends
TestCase
29
{
30
protected
ilKSDocumentationEntryGUI
$entry_gui
;
31
32
protected
function
setUp
(): void
33
{
34
$ui_helper =
new
UITestHelper
();
35
36
$ctrl = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->onlyMethods([
37
'setParameterByClass'
38
])->getMock();
39
40
$entries_data = include
'./components/ILIAS/UI/tests/Crawler/Fixture/EntriesFixture.php'
;
41
$entries =
new
Entries();
42
$entries->addEntriesFromArray($entries_data);
43
44
$this->entry_gui =
new
ilKSDocumentationEntryGUI(
45
$ui_helper->factory(),
46
$ctrl,
47
$entries,
48
'Entry1'
49
);
50
}
51
52
public
function
testConstruct
(): void
53
{
54
$this->assertInstanceOf(ilKSDocumentationEntryGUI::class, $this->entry_gui);
55
}
56
57
public
function
testRenderEntry
(): void
58
{
59
$report = $this->entry_gui->createUIComponentOfEntry();
60
$this->assertInstanceOf(Report::class, $report);
61
$this->assertEquals(
'Entry1Title'
, $report->getTitle());
62
}
63
}
UITestHelper
trait UITestHelper
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...
Definition:
UITestHelper.php:36
ILIAS\UI\Implementation\Component\Panel\Report
Definition:
Report.php:32
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntries
Container storing a list of UI Component Entries, can act as Iterator, countable and is serializable.
Definition:
ComponentEntries.php:35
ilKSDocumentationEntryGUITest
Definition:
ilKSDocumentationEntryGUITest.php:29
ilKSDocumentationEntryGUITest\setUp
setUp()
Definition:
ilKSDocumentationEntryGUITest.php:32
ilKSDocumentationEntryGUITest\testRenderEntry
testRenderEntry()
Definition:
ilKSDocumentationEntryGUITest.php:57
ilKSDocumentationEntryGUITest\testConstruct
testConstruct()
Definition:
ilKSDocumentationEntryGUITest.php:52
ilKSDocumentationEntryGUITest\$entry_gui
ilKSDocumentationEntryGUI $entry_gui
Definition:
ilKSDocumentationEntryGUITest.php:30
components
ILIAS
Style
System
test
Documentation
ilKSDocumentationEntryGUITest.php
Generated on Wed Jun 3 2026 23:06:54 for ILIAS by
1.9.4 (using
Doxyfile
)