ILIAS  release_8 Revision v8.24
ilTestServiceGUITest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTestServiceGUITest:
+ Collaboration diagram for ilTestServiceGUITest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testContextResultPresentation ()
 
 testParticipantData ()
 
 testObjectiveOrientedContainer ()
 
 testGetCommand ()
 
 testBuildFixedShufflerSeedReturnsValidSeed ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 
 addGlobal_ilAccess ()
 
 addGlobal_ilUser ()
 
 addGlobal_objDefinition ()
 
 addGlobal_tree ()
 
 addGlobal_ilSetting ()
 
 addGlobal_rbacsystem ()
 
 addGlobal_ilCtrl ()
 
 addGlobal_lng ()
 
 addGlobal_filesystem ()
 
 addGlobal_upload ()
 
 addGlobal_ilDB ()
 
 addGlobal_ilLog ()
 
 addGlobal_ilias ()
 
 addGlobal_ilErr ()
 
 addGlobal_ilAppEventHandler ()
 
 addGlobal_tpl ()
 
 addGlobal_ilComponentRepository ()
 
 addGlobal_ilTabs ()
 
 addGlobal_ilObjDataCache ()
 
 addGlobal_ilLocator ()
 
 addGlobal_rbacreview ()
 
 addGlobal_ilToolbar ()
 
 addGlobal_http ()
 
 addGlobal_ilIliasIniFile ()
 
 addGlobal_ilLoggerFactory ()
 
 addGlobal_ilHelp ()
 
 addGlobal_ui ()
 
 addGlobal_uiFactory ()
 
 addGlobal_uiRenderer ()
 
 addGlobal_refinery ()
 

Private Attributes

ilTestServiceGUI $testObj
 

Additional Inherited Members

- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilTestServiceGUITest

Author
Marvin Beym mbeym.nosp@m.@dat.nosp@m.abay..nosp@m.de

Definition at line 25 of file ilTestServiceGUITest.php.

Member Function Documentation

◆ setUp()

ilTestServiceGUITest::setUp ( )
protected

Reimplemented from ilTestBaseTestCase.

Definition at line 29 of file ilTestServiceGUITest.php.

29 : void
30 {
31 parent::setUp();
32
33 $this->addGlobal_lng();
34 $this->addGlobal_tpl();
35 $this->addGlobal_ilCtrl();
36 $this->addGlobal_ilias();
37 $this->addGlobal_tree();
38 $this->addGlobal_ilDB();
40 $this->addGlobal_ilTabs();
42
43 $this->testObj = new ilTestServiceGUI($this->createMock(ilObjTest::class));
44 }
Service GUI class for tests.

References ilTestBaseTestCase\addGlobal_ilComponentRepository(), ilTestBaseTestCase\addGlobal_ilCtrl(), ilTestBaseTestCase\addGlobal_ilDB(), ilTestBaseTestCase\addGlobal_ilias(), ilTestBaseTestCase\addGlobal_ilObjDataCache(), ilTestBaseTestCase\addGlobal_ilTabs(), ilTestBaseTestCase\addGlobal_lng(), ilTestBaseTestCase\addGlobal_tpl(), and ilTestBaseTestCase\addGlobal_tree().

+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

ilTestServiceGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 46 of file ilTestServiceGUITest.php.

46 : void
47 {
48 $this->assertInstanceOf(ilTestServiceGUI::class, $this->testObj);
49 }

◆ testBuildFixedShufflerSeedReturnsValidSeed()

ilTestServiceGUITest::testBuildFixedShufflerSeedReturnsValidSeed ( )

Definition at line 79 of file ilTestServiceGUITest.php.

79 : void
80 {
81 $seeds = [
82 [
83 'question_id' => 1,
84 'pass_id' => 1,
85 'active_id' => 1,
86 'return' => 10000004
87 ],
88 [
89 'question_id' => 9999999,
90 'pass_id' => 1,
91 'active_id' => 1,
92 'return' => 10000000
93 ],
94 [
95 'question_id' => 234342342342342334,
96 'pass_id' => 11,
97 'active_id' => 1634545234234232344,
98 'return' => 1634545234234232355
99 ],
100 [
101 'question_id' => 23434234,
102 'pass_id' => 11,
103 'active_id' => 9223372036854775804,
104 'return' => 9223372036854775804
105 ]
106 ];
107
108 $reflection = new \ReflectionClass(ilTestServiceGUI::class);
109 $method = $reflection->getMethod('buildFixedShufflerSeed');
110 $method->setAccessible(true);
111
112 foreach ($seeds as $seed) {
113 $fixed_seed = $method->invoke($this->testObj, $seed['question_id'], $seed['pass_id'], $seed['active_id']);
114 $this->assertEquals($seed['return'], $fixed_seed);
115 }
116 }

◆ testContextResultPresentation()

ilTestServiceGUITest::testContextResultPresentation ( )

Definition at line 51 of file ilTestServiceGUITest.php.

51 : void
52 {
53 $this->testObj->setContextResultPresentation(false);
54 $this->assertFalse($this->testObj->isContextResultPresentation());
55
56 $this->testObj->setContextResultPresentation(true);
57 $this->assertTrue($this->testObj->isContextResultPresentation());
58 }

◆ testGetCommand()

ilTestServiceGUITest::testGetCommand ( )

Definition at line 74 of file ilTestServiceGUITest.php.

74 : void
75 {
76 $this->assertEquals("testCmd", $this->testObj->getCommand("testCmd"));
77 }

◆ testObjectiveOrientedContainer()

ilTestServiceGUITest::testObjectiveOrientedContainer ( )

Definition at line 67 of file ilTestServiceGUITest.php.

67 : void
68 {
69 $mock = $this->createMock(ilTestObjectiveOrientedContainer::class);
70 $this->testObj->setObjectiveOrientedContainer($mock);
71 $this->assertEquals($mock, $this->testObj->getObjectiveOrientedContainer());
72 }

◆ testParticipantData()

ilTestServiceGUITest::testParticipantData ( )

Definition at line 60 of file ilTestServiceGUITest.php.

60 : void
61 {
62 $mock = $this->createMock(ilTestParticipantData::class);
63 $this->testObj->setParticipantData($mock);
64 $this->assertEquals($mock, $this->testObj->getParticipantData());
65 }

Field Documentation

◆ $testObj

ilTestServiceGUI ilTestServiceGUITest::$testObj
private

Definition at line 27 of file ilTestServiceGUITest.php.


The documentation for this class was generated from the following file: