ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestInfoScreenToolbarGUITest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
28 
29  protected function setUp(): void
30  {
31  global $DIC;
32  parent::setUp();
33 
34  $this->addGlobal_ilToolbar();
35 
36  $this->testInfoScreenToolbarGUI = new ilTestInfoScreenToolbarGUI(
37  $this->getTestObjMock(),
38  $this->createMock(ilTestPlayerFixedQuestionSetGUI::class),
39  $this->createMock(ilTestQuestionSetConfig::class),
40  $this->createMock(ilTestSession::class),
41  $DIC['ilDB'],
42  $DIC['ilAccess'],
43  $DIC['ilCtrl'],
44  $DIC['lng'],
45  $DIC['ui.factory'],
46  $DIC['ui.renderer'],
47  $DIC['tpl'],
48  $DIC['ilToolbar']
49  );
50  }
51 
53  {
54  $this->assertInstanceOf(ilTestInfoScreenToolbarGUI::class, $this->testInfoScreenToolbarGUI);
55  }
56 
57  public function testSessionLockString(): void
58  {
59  $this->assertEquals('', $this->testInfoScreenToolbarGUI->getSessionLockString());
60 
61  $this->testInfoScreenToolbarGUI->setSessionLockString("testString");
62 
63  $this->assertEquals("testString", $this->testInfoScreenToolbarGUI->getSessionLockString());
64  }
65 
66  public function testInfoMessages(): void
67  {
68  $this->assertIsArray($this->testInfoScreenToolbarGUI->getInfoMessages());
69 
70  $expected = ["test1", "test2", "3test", "4test"];
71 
72  foreach ($expected as $value) {
73  $this->testInfoScreenToolbarGUI->addInfoMessage($value);
74  }
75 
76  $this->assertEquals($expected, $this->testInfoScreenToolbarGUI->getInfoMessages());
77  }
78 
79  public function testFailureMessages(): void
80  {
81  $this->assertIsArray($this->testInfoScreenToolbarGUI->getFailureMessages());
82 
83  $expected = ["test1", "test2", "3test", "4test"];
84 
85  foreach ($expected as $value) {
86  $this->testInfoScreenToolbarGUI->addFailureMessage($value);
87  }
88 
89  $this->assertEquals($expected, $this->testInfoScreenToolbarGUI->getFailureMessages());
90  }
91 }
Class ilTestInfoScreenToolbarGUITest.
ilTestInfoScreenToolbarGUI $testInfoScreenToolbarGUI
global $DIC
Definition: shib_login.php:22