ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSystemStyleDocumentationGUITest.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 
26 
28 {
31 
32  protected function setUp(): void
33  {
34  $ui_helper = new UITestHelper();
35  $this->tpl_observer = $this->getMockBuilder(ilGlobalPageTemplate::class)->disableOriginalConstructor()->getMock();
36  $ctrl = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->getMock();
37 
38  $this->documentation_gui = new ilSystemStyleDocumentationGUI(
39  $this->tpl_observer,
40  $ctrl,
41  $ui_helper->factory(),
42  $ui_helper->renderer()
43  );
44  }
45 
46  public function testConstruct(): void
47  {
48  $this->assertInstanceOf(ilSystemStyleDocumentationGUI::class, $this->documentation_gui);
49  }
50 
51  public function testShow(): void
52  {
53  $entries_data = include './components/ILIAS/UI/tests/Crawler/Fixture/EntriesFixture.php';
54  $entries = new Entries();
55  $entries->addEntriesFromArray($entries_data);
56  $this->tpl_observer->expects($this->once())
57  ->method('setContent')
58  ->with($this->stringContains('Entry1Title'));
59  $this->documentation_gui->show($entries, 'Entry1');
60  }
61 }
Container storing a list of UI Component Entries, can act as Iterator, countable and is serializable...
Renders the Overview of the Examples in the Administration.
trait UITestHelper
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...