3 declare(strict_types=1);
29 protected function setUp(): void
34 $this->getMockBuilder(ilTree::class)->disableOriginalConstructor()->getMock(),
35 $this->createMock(ilDBInterface::class),
36 $this->createMock(ilComponentRepository::class),
37 $this->getMockBuilder(ilObjTest::class)->disableOriginalConstructor()->getMock()
43 $this->assertInstanceOf(ilObjTestDynamicQuestionSetConfig::class, $this->testObj);
48 $this->testObj->setSourceQuestionPoolId(125);
49 $this->assertEquals(125, $this->testObj->getSourceQuestionPoolId());
54 $this->testObj->setSourceQuestionPoolTitle(
"testString");
55 $this->assertEquals(
"testString", $this->testObj->getSourceQuestionPoolTitle());
60 $this->testObj->setAnswerStatusFilterEnabled(
false);
61 $this->assertFalse($this->testObj->isAnswerStatusFilterEnabled());
63 $this->testObj->setAnswerStatusFilterEnabled(
true);
64 $this->assertTrue($this->testObj->isAnswerStatusFilterEnabled());
69 $this->testObj->setTaxonomyFilterEnabled(
false);
70 $this->assertFalse($this->testObj->isTaxonomyFilterEnabled());
72 $this->testObj->setTaxonomyFilterEnabled(
true);
73 $this->assertTrue($this->testObj->isTaxonomyFilterEnabled());
78 $this->testObj->setOrderingTaxonomyId(1231);
79 $this->assertEquals(1231, $this->testObj->getOrderingTaxonomyId());
85 "source_qpl_fi" => 126,
86 "source_qpl_title" =>
"testString",
87 "answer_filter_enabled" =>
true,
88 "tax_filter_enabled" =>
false,
92 $this->testObj->initFromArray($expected);
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());
103 $this->assertFalse($this->testObj->isQuestionSetConfigured());
105 $this->testObj->setSourceQuestionPoolId(168);
106 $this->assertTrue($this->testObj->isQuestionSetConfigured());
111 $this->assertFalse($this->testObj->isQuestionSetConfigured());
112 $this->assertFalse($this->testObj->doesQuestionSetRelatedDataExist());
114 $this->testObj->setSourceQuestionPoolId(168);
115 $this->assertTrue($this->testObj->isQuestionSetConfigured());
116 $this->assertTrue($this->testObj->doesQuestionSetRelatedDataExist());
123 $this->testObj->setSourceQuestionPoolId(16);
124 $this->testObj->setSourceQuestionPoolTitle(
"testTitle");
126 $lng_mock = $this->createMock(ilLanguage::class);
127 $lng_mock->expects($this->any())
129 ->with(
"tst_dyn_quest_set_src_qpl_summary_string_deleted")
130 ->willReturn(
"testString");
132 $result = $this->testObj->getSourceQuestionPoolSummaryString($lng_mock);
134 $this->assertEquals(
"testString", $result);
141 $this->testObj->setSourceQuestionPoolId(16);
142 $this->testObj->setSourceQuestionPoolTitle(
"testTitle");
144 $lng_mock = $this->createMock(ilLanguage::class);
145 $lng_mock->expects($this->any())
147 ->with(
"tst_dyn_quest_set_pool_trashed")
148 ->willReturn(
"testString");
150 $result = $this->testObj->getDepenciesInVulnerableStateMessage($lng_mock);
152 $this->assertEquals(
"testString", $result);
159 $this->assertFalse($this->testObj->areDepenciesBroken());
161 $this->testObj->setSourceQuestionPoolId(16);
162 $this->assertTrue($this->testObj->areDepenciesBroken());
169 $this->testObj->setSourceQuestionPoolId(16);
170 $this->testObj->setSourceQuestionPoolTitle(
"testTitle");
172 $lng_mock = $this->createMock(ilLanguage::class);
173 $lng_mock->expects($this->any())
175 ->with(
"tst_dyn_quest_set_pool_deleted")
176 ->willReturn(
"testString");
178 $result = $this->testObj->getDepenciesBrokenMessage($lng_mock);
180 $this->assertEquals(
"testString", $result);
194 $result = $this->testObj->getHiddenTabsOnBrokenDepencies();
195 $this->assertEquals($expected, $result);
200 $this->assertFalse($this->testObj->isResultTaxonomyFilterSupported());
205 $this->assertFalse($this->testObj->isAnyQuestionFilterEnabled());
207 $this->testObj->setTaxonomyFilterEnabled(
false);
208 $this->assertFalse($this->testObj->isAnyQuestionFilterEnabled());
210 $this->testObj->setTaxonomyFilterEnabled(
true);
211 $this->assertTrue($this->testObj->isAnyQuestionFilterEnabled());
ilObjTestDynamicQuestionSetConfig $testObj
testTaxonomyFilterEnabled()
testGetDepenciesBrokenMessage()
test_instantiateObject_shouldReturnInstance()
testIsQuestionSetConfigured()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testGetDepenciesInVulnerableStateMessage()
testAnswerStatusFilterEnabled()
testSourceQuestionPoolTitle()
testIsAnyQuestionFilterEnabled()
testGetHiddenTabsOnBrokenDepencies()
testDoesQuestionSetRelatedDataExist()
testGetSourceQuestionPoolSummaryString()
testIsResultTaxonomyFilterSupported()
testSourceQuestionPoolId()