ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilTestPassDetailsOverviewTableGUITest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
29
30 protected function setUp(): void
31 {
33
34 $lng_mock = $this->createMock(ilLanguage::class);
35 $ctrl_mock = $this->createMock(ilCtrl::class);
36 $ctrl_mock->method("getFormAction")
37 ->willReturnCallback(function () {
38 return "testFormAction";
39 });
40
41 $this->setGlobalVariable("lng", $lng_mock);
42 $this->setGlobalVariable("ilCtrl", $ctrl_mock);
43 $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
44 $this->setGlobalVariable("component.repository", $this->createMock(ilComponentRepository::class));
45 $component_factory = $this->createMock(ilComponentFactory::class);
46 $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
47 $this->setGlobalVariable("component.factory", $component_factory);
48 $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
49
50 $this->parentObj_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(['getObject'])->getMock();
51 $this->parentObj_mock->method('getObject')->willReturn($this->getTestObjMock());
52 $this->tableGui = new ilTestPassDetailsOverviewTableGUI(
53 $ctrl_mock,
54 $this->createMock(ilTestServiceGUI::class),
55 ""
56 );
57 }
58
60 {
61 $this->assertInstanceOf(ilTestPassDetailsOverviewTableGUI::class, $this->tableGui);
62 }
63
64 public function testPdfGenerationRequest(): void
65 {
66 $this->assertIsBool($this->tableGui->isPdfGenerationRequest());
67 $this->tableGui->setIsPdfGenerationRequest(false);
68 $this->assertFalse($this->tableGui->isPdfGenerationRequest());
69 $this->tableGui->setIsPdfGenerationRequest(true);
70 $this->assertTrue($this->tableGui->isPdfGenerationRequest());
71 }
72
73 public function testAnswerListAnchorEnabled(): void
74 {
75 $this->assertIsBool($this->tableGui->getAnswerListAnchorEnabled());
76 $this->tableGui->setAnswerListAnchorEnabled(false);
77 $this->assertFalse($this->tableGui->getAnswerListAnchorEnabled());
78 $this->tableGui->setAnswerListAnchorEnabled(true);
79 $this->assertTrue($this->tableGui->getAnswerListAnchorEnabled());
80 }
81
82 public function testShowSuggestedSolution(): void
83 {
84 $this->assertIsBool($this->tableGui->getShowSuggestedSolution());
85 $this->tableGui->setShowSuggestedSolution(false);
86 $this->assertFalse($this->tableGui->getShowSuggestedSolution());
87 $this->tableGui->setShowSuggestedSolution(true);
88 $this->assertTrue($this->tableGui->getShowSuggestedSolution());
89 }
90
91 public function testActiveId(): void
92 {
93 $this->tableGui->setActiveId(200);
94 $this->assertEquals(200, $this->tableGui->getActiveId());
95 }
96
98 {
99 $this->assertIsBool($this->tableGui->isObjectiveOrientedPresentationEnabled());
100 $this->tableGui->setObjectiveOrientedPresentationEnabled(false);
101 $this->assertFalse($this->tableGui->isObjectiveOrientedPresentationEnabled());
102 $this->tableGui->setObjectiveOrientedPresentationEnabled(true);
103 $this->assertTrue($this->tableGui->isObjectiveOrientedPresentationEnabled());
104 }
105
106 public function testMultipleObjectivesInvolved(): void
107 {
108 $this->assertIsBool($this->tableGui->areMultipleObjectivesInvolved());
109 $this->tableGui->setMultipleObjectivesInvolved(false);
110 $this->assertFalse($this->tableGui->areMultipleObjectivesInvolved());
111 $this->tableGui->setMultipleObjectivesInvolved(true);
112 $this->assertTrue($this->tableGui->areMultipleObjectivesInvolved());
113 }
114
115 public function testPassColumnEnabled(): void
116 {
117 $this->assertIsBool($this->tableGui->isPassColumnEnabled());
118 $this->tableGui->setPassColumnEnabled(false);
119 $this->assertFalse($this->tableGui->isPassColumnEnabled());
120 $this->tableGui->setPassColumnEnabled(true);
121 $this->assertTrue($this->tableGui->isPassColumnEnabled());
122 }
123}
Class ilObjTestGUI.
Class ilTestBaseClass.
Class ilTestPassDetailsOverviewTableGUITest.
setGlobalVariable(string $name, mixed $value)