ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilTestPassOverviewTableGUITest.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(ilTestEvaluationGUI::class)->disableOriginalConstructor()->onlyMethods(['getObject'])->getMock();
51 $this->parentObj_mock->method('getObject')->willReturn($this->getTestObjMock());
52 $this->tableGui = new ilTestPassOverviewTableGUI($this->parentObj_mock, "");
53 }
54
56 {
57 $this->assertInstanceOf(ilTestPassOverviewTableGUI::class, $this->tableGui);
58 }
59
60 public function testNumericOrdering(): void
61 {
62 $this->assertTrue($this->tableGui->numericOrdering("pass"));
63 $this->assertTrue($this->tableGui->numericOrdering("date"));
64 $this->assertTrue($this->tableGui->numericOrdering("percentage"));
65 $this->assertFalse($this->tableGui->numericOrdering("randomText"));
66 }
67
68 public function testResultPresentationEnabled(): void
69 {
70 $this->assertIsBool($this->tableGui->isResultPresentationEnabled());
71 $this->tableGui->setResultPresentationEnabled(false);
72 $this->assertFalse($this->tableGui->isResultPresentationEnabled());
73 $this->tableGui->setResultPresentationEnabled(true);
74 $this->assertTrue($this->tableGui->isResultPresentationEnabled());
75 }
76
77 public function testPdfPresentationEnabled(): void
78 {
79 $this->assertIsBool($this->tableGui->isPdfPresentationEnabled());
80 $this->tableGui->setPdfPresentationEnabled(false);
81 $this->assertFalse($this->tableGui->isPdfPresentationEnabled());
82 $this->tableGui->setPdfPresentationEnabled(true);
83 $this->assertTrue($this->tableGui->isPdfPresentationEnabled());
84 }
85
87 {
88 $this->assertIsBool($this->tableGui->isObjectiveOrientedPresentationEnabled());
89 $this->tableGui->setObjectiveOrientedPresentationEnabled(false);
90 $this->assertFalse($this->tableGui->isObjectiveOrientedPresentationEnabled());
91 $this->tableGui->setObjectiveOrientedPresentationEnabled(true);
92 $this->assertTrue($this->tableGui->isObjectiveOrientedPresentationEnabled());
93 }
94
95 public function testActiveId(): void
96 {
97 $this->tableGui->setActiveId(20);
98 $this->assertEquals(20, $this->tableGui->getActiveId());
99 }
100
101 public function testPassDetailsCommand(): void
102 {
103 $this->assertIsString($this->tableGui->getPassDetailsCommand());
104 $this->tableGui->setPassDetailsCommand("testString");
105 $this->assertEquals("testString", $this->tableGui->getPassDetailsCommand());
106 }
107
108 public function testPassDeletionCommand(): void
109 {
110 $this->assertIsString($this->tableGui->getPassDeletionCommand());
111 $this->tableGui->setPassDeletionCommand("testString");
112 $this->assertEquals("testString", $this->tableGui->getPassDeletionCommand());
113 }
114}
Class ilTestBaseClass.
Output class for assessment test evaluation.
Class ilTestPassOverviewTableGUITest.
Class ilTestPassOverviewTableGUI.
setGlobalVariable(string $name, mixed $value)