ILIAS  release_8 Revision v8.24
ilObjTestDynamicQuestionSetConfigTest 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 ilObjTestDynamicQuestionSetConfigTest:
+ Collaboration diagram for ilObjTestDynamicQuestionSetConfigTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testSourceQuestionPoolId ()
 
 testSourceQuestionPoolTitle ()
 
 testAnswerStatusFilterEnabled ()
 
 testTaxonomyFilterEnabled ()
 
 testOrderingTaxonomyId ()
 
 testInitFromArray ()
 
 testIsQuestionSetConfigured ()
 
 testDoesQuestionSetRelatedDataExist ()
 
 testGetSourceQuestionPoolSummaryString ()
 
 testGetDepenciesInVulnerableStateMessage ()
 
 testAreDepenciesBroken ()
 
 testGetDepenciesBrokenMessage ()
 
 testGetHiddenTabsOnBrokenDepencies ()
 
 testIsResultTaxonomyFilterSupported ()
 
 testIsAnyQuestionFilterEnabled ()
 

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

ilObjTestDynamicQuestionSetConfig $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 ilObjTestDynamicQuestionSetConfigTest

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

Definition at line 25 of file ilObjTestDynamicQuestionSetConfigTest.php.

Member Function Documentation

◆ setUp()

ilObjTestDynamicQuestionSetConfigTest::setUp ( )
protected

Reimplemented from ilTestBaseTestCase.

Definition at line 29 of file ilObjTestDynamicQuestionSetConfigTest.php.

29 : void
30 {
31 parent::setUp();
32
33 $this->testObj = new ilObjTestDynamicQuestionSetConfig(
34 $this->getMockBuilder(ilTree::class)->disableOriginalConstructor()->getMock(),
35 $this->createMock(ilDBInterface::class),
36 $this->createMock(ilComponentRepository::class),
37 $this->getMockBuilder(ilObjTest::class)->disableOriginalConstructor()->getMock()
38 );
39 }

◆ test_instantiateObject_shouldReturnInstance()

ilObjTestDynamicQuestionSetConfigTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 41 of file ilObjTestDynamicQuestionSetConfigTest.php.

41 : void
42 {
43 $this->assertInstanceOf(ilObjTestDynamicQuestionSetConfig::class, $this->testObj);
44 }

◆ testAnswerStatusFilterEnabled()

ilObjTestDynamicQuestionSetConfigTest::testAnswerStatusFilterEnabled ( )

Definition at line 58 of file ilObjTestDynamicQuestionSetConfigTest.php.

58 : void
59 {
60 $this->testObj->setAnswerStatusFilterEnabled(false);
61 $this->assertFalse($this->testObj->isAnswerStatusFilterEnabled());
62
63 $this->testObj->setAnswerStatusFilterEnabled(true);
64 $this->assertTrue($this->testObj->isAnswerStatusFilterEnabled());
65 }

◆ testAreDepenciesBroken()

ilObjTestDynamicQuestionSetConfigTest::testAreDepenciesBroken ( )

Definition at line 155 of file ilObjTestDynamicQuestionSetConfigTest.php.

155 : void
156 {
157 $this->addGlobal_ilDB();
158
159 $this->assertFalse($this->testObj->areDepenciesBroken());
160
161 $this->testObj->setSourceQuestionPoolId(16);
162 $this->assertTrue($this->testObj->areDepenciesBroken());
163 }

References ilTestBaseTestCase\addGlobal_ilDB().

+ Here is the call graph for this function:

◆ testDoesQuestionSetRelatedDataExist()

ilObjTestDynamicQuestionSetConfigTest::testDoesQuestionSetRelatedDataExist ( )

Definition at line 109 of file ilObjTestDynamicQuestionSetConfigTest.php.

109 : void
110 {
111 $this->assertFalse($this->testObj->isQuestionSetConfigured());
112 $this->assertFalse($this->testObj->doesQuestionSetRelatedDataExist());
113
114 $this->testObj->setSourceQuestionPoolId(168);
115 $this->assertTrue($this->testObj->isQuestionSetConfigured());
116 $this->assertTrue($this->testObj->doesQuestionSetRelatedDataExist());
117 }

◆ testGetDepenciesBrokenMessage()

ilObjTestDynamicQuestionSetConfigTest::testGetDepenciesBrokenMessage ( )

Definition at line 165 of file ilObjTestDynamicQuestionSetConfigTest.php.

165 : void
166 {
167 $this->addGlobal_ilDB();
168
169 $this->testObj->setSourceQuestionPoolId(16);
170 $this->testObj->setSourceQuestionPoolTitle("testTitle");
171
172 $lng_mock = $this->createMock(ilLanguage::class);
173 $lng_mock->expects($this->any())
174 ->method("txt")
175 ->with("tst_dyn_quest_set_pool_deleted")
176 ->willReturn("testString");
177
178 $result = $this->testObj->getDepenciesBrokenMessage($lng_mock);
179
180 $this->assertEquals("testString", $result);
181 }

References ilTestBaseTestCase\addGlobal_ilDB().

+ Here is the call graph for this function:

◆ testGetDepenciesInVulnerableStateMessage()

ilObjTestDynamicQuestionSetConfigTest::testGetDepenciesInVulnerableStateMessage ( )

Definition at line 137 of file ilObjTestDynamicQuestionSetConfigTest.php.

137 : void
138 {
139 $this->addGlobal_ilDB();
140
141 $this->testObj->setSourceQuestionPoolId(16);
142 $this->testObj->setSourceQuestionPoolTitle("testTitle");
143
144 $lng_mock = $this->createMock(ilLanguage::class);
145 $lng_mock->expects($this->any())
146 ->method("txt")
147 ->with("tst_dyn_quest_set_pool_trashed")
148 ->willReturn("testString");
149
150 $result = $this->testObj->getDepenciesInVulnerableStateMessage($lng_mock);
151
152 $this->assertEquals("testString", $result);
153 }

References ilTestBaseTestCase\addGlobal_ilDB().

+ Here is the call graph for this function:

◆ testGetHiddenTabsOnBrokenDepencies()

ilObjTestDynamicQuestionSetConfigTest::testGetHiddenTabsOnBrokenDepencies ( )

Definition at line 183 of file ilObjTestDynamicQuestionSetConfigTest.php.

183 : void
184 {
185 $expected = [
186 'settings',
187 'manscoring',
188 'scoringadjust',
189 'statistics',
190 'history',
191 'export'
192 ];
193
194 $result = $this->testObj->getHiddenTabsOnBrokenDepencies();
195 $this->assertEquals($expected, $result);
196 }

◆ testGetSourceQuestionPoolSummaryString()

ilObjTestDynamicQuestionSetConfigTest::testGetSourceQuestionPoolSummaryString ( )

Definition at line 119 of file ilObjTestDynamicQuestionSetConfigTest.php.

119 : void
120 {
121 $this->addGlobal_ilDB();
122
123 $this->testObj->setSourceQuestionPoolId(16);
124 $this->testObj->setSourceQuestionPoolTitle("testTitle");
125
126 $lng_mock = $this->createMock(ilLanguage::class);
127 $lng_mock->expects($this->any())
128 ->method("txt")
129 ->with("tst_dyn_quest_set_src_qpl_summary_string_deleted")
130 ->willReturn("testString");
131
132 $result = $this->testObj->getSourceQuestionPoolSummaryString($lng_mock);
133
134 $this->assertEquals("testString", $result);
135 }

References ilTestBaseTestCase\addGlobal_ilDB().

+ Here is the call graph for this function:

◆ testInitFromArray()

ilObjTestDynamicQuestionSetConfigTest::testInitFromArray ( )

Definition at line 82 of file ilObjTestDynamicQuestionSetConfigTest.php.

82 : void
83 {
84 $expected = [
85 "source_qpl_fi" => 126,
86 "source_qpl_title" => "testString",
87 "answer_filter_enabled" => true,
88 "tax_filter_enabled" => false,
89 "order_tax" => 1369,
90 ];
91
92 $this->testObj->initFromArray($expected);
93
94 $this->assertEquals($expected["source_qpl_fi"], $this->testObj->getSourceQuestionPoolId());
95 $this->assertEquals($expected["source_qpl_title"], $this->testObj->getSourceQuestionPoolTitle());
96 $this->assertEquals($expected["answer_filter_enabled"], $this->testObj->isAnswerStatusFilterEnabled());
97 $this->assertEquals($expected["tax_filter_enabled"], $this->testObj->isTaxonomyFilterEnabled());
98 $this->assertEquals($expected["order_tax"], $this->testObj->getOrderingTaxonomyId());
99 }

◆ testIsAnyQuestionFilterEnabled()

ilObjTestDynamicQuestionSetConfigTest::testIsAnyQuestionFilterEnabled ( )

Definition at line 203 of file ilObjTestDynamicQuestionSetConfigTest.php.

203 : void
204 {
205 $this->assertFalse($this->testObj->isAnyQuestionFilterEnabled());
206
207 $this->testObj->setTaxonomyFilterEnabled(false);
208 $this->assertFalse($this->testObj->isAnyQuestionFilterEnabled());
209
210 $this->testObj->setTaxonomyFilterEnabled(true);
211 $this->assertTrue($this->testObj->isAnyQuestionFilterEnabled());
212 }

◆ testIsQuestionSetConfigured()

ilObjTestDynamicQuestionSetConfigTest::testIsQuestionSetConfigured ( )

Definition at line 101 of file ilObjTestDynamicQuestionSetConfigTest.php.

101 : void
102 {
103 $this->assertFalse($this->testObj->isQuestionSetConfigured());
104
105 $this->testObj->setSourceQuestionPoolId(168);
106 $this->assertTrue($this->testObj->isQuestionSetConfigured());
107 }

◆ testIsResultTaxonomyFilterSupported()

ilObjTestDynamicQuestionSetConfigTest::testIsResultTaxonomyFilterSupported ( )

Definition at line 198 of file ilObjTestDynamicQuestionSetConfigTest.php.

198 : void
199 {
200 $this->assertFalse($this->testObj->isResultTaxonomyFilterSupported());
201 }

◆ testOrderingTaxonomyId()

ilObjTestDynamicQuestionSetConfigTest::testOrderingTaxonomyId ( )

Definition at line 76 of file ilObjTestDynamicQuestionSetConfigTest.php.

76 : void
77 {
78 $this->testObj->setOrderingTaxonomyId(1231);
79 $this->assertEquals(1231, $this->testObj->getOrderingTaxonomyId());
80 }

◆ testSourceQuestionPoolId()

ilObjTestDynamicQuestionSetConfigTest::testSourceQuestionPoolId ( )

Definition at line 46 of file ilObjTestDynamicQuestionSetConfigTest.php.

46 : void
47 {
48 $this->testObj->setSourceQuestionPoolId(125);
49 $this->assertEquals(125, $this->testObj->getSourceQuestionPoolId());
50 }

◆ testSourceQuestionPoolTitle()

ilObjTestDynamicQuestionSetConfigTest::testSourceQuestionPoolTitle ( )

Definition at line 52 of file ilObjTestDynamicQuestionSetConfigTest.php.

52 : void
53 {
54 $this->testObj->setSourceQuestionPoolTitle("testString");
55 $this->assertEquals("testString", $this->testObj->getSourceQuestionPoolTitle());
56 }

◆ testTaxonomyFilterEnabled()

ilObjTestDynamicQuestionSetConfigTest::testTaxonomyFilterEnabled ( )

Definition at line 67 of file ilObjTestDynamicQuestionSetConfigTest.php.

67 : void
68 {
69 $this->testObj->setTaxonomyFilterEnabled(false);
70 $this->assertFalse($this->testObj->isTaxonomyFilterEnabled());
71
72 $this->testObj->setTaxonomyFilterEnabled(true);
73 $this->assertTrue($this->testObj->isTaxonomyFilterEnabled());
74 }

Field Documentation

◆ $testObj

ilObjTestDynamicQuestionSetConfig ilObjTestDynamicQuestionSetConfigTest::$testObj
private

Definition at line 27 of file ilObjTestDynamicQuestionSetConfigTest.php.


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