ILIAS  release_8 Revision v8.23
ilKSDocumentationEntryGUITest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 require_once('libs/composer/vendor/autoload.php');
22 include_once('./tests/UI/UITestHelper.php');
23 
25 
28 
29 class ilKSDocumentationEntryGUITest extends TestCase
30 {
32 
33  protected function setUp(): void
34  {
35  $ui_helper = new UITestHelper();
36 
37  $ctrl = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->onlyMethods([
38  'setParameterByClass'
39  ])->getMock();
40 
41  $entries_data = include './tests/UI/Crawler/Fixture/EntriesFixture.php';
42  $entries = new Entries();
43  $entries->addEntriesFromArray($entries_data);
44 
45  $this->entry_gui = new ilKSDocumentationEntryGUI(
46  $ui_helper->factory(),
47  $ctrl,
48  $entries,
49  'Entry1'
50  );
51  }
52 
53  public function testConstruct(): void
54  {
55  $this->assertInstanceOf(ilKSDocumentationEntryGUI::class, $this->entry_gui);
56  }
57 
58  public function testRenderEntry(): void
59  {
60  $report = $this->entry_gui->createUIComponentOfEntry();
61  $this->assertInstanceOf(Report::class, $report);
62  $this->assertEquals('Entry1Title', $report->getTitle());
63  }
64 }
Container storing a list of UI Component Entries, can act as Iterator, countable and is serializable...
Renders the Overview of one Example in the Administration.
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...