ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilResultsByQuestionTableGUITest.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 ilResultsByQuestionTableGUI($this->parentObj_mock, "");
53 }
54
56 {
57 $this->assertInstanceOf(ilResultsByQuestionTableGUI::class, $this->tableGui);
58 }
59
60 public function testNumericOrdering(): void
61 {
62 $this->assertTrue($this->tableGui->numericOrdering("qid"));
63 $this->assertTrue($this->tableGui->numericOrdering("number_of_answers"));
64 $this->assertFalse($this->tableGui->numericOrdering("randomString"));
65 }
66}
Class ilResultsByQuestionTableGUITest.
TableGUI class for results by question.
Class ilTestBaseClass.
Output class for assessment test evaluation.
setGlobalVariable(string $name, mixed $value)