ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 
25 
28 
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 './components/ILIAS/UI/tests/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.
trait UITestHelper
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...