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