ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestRandomQuestionSetSourcePoolDefinitionListTableGUITest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
26 {
29 
30  protected function setUp(): void
31  {
32  parent::setUp();
33 
34  $this->addGlobal_uiFactory();
35  $this->addGlobal_uiRenderer();
36  $this->addGlobal_ilAccess();
37 
38  $lng_mock = $this->createMock(ilLanguage::class);
39  $ctrl_mock = $this->createMock(ilCtrl::class);
40  $ctrl_mock->expects($this->any())
41  ->method("getFormAction")
42  ->willReturnCallback(function () {
43  return "testFormAction";
44  });
45 
46  $this->setGlobalVariable("lng", $lng_mock);
47  $this->setGlobalVariable("ilCtrl", $ctrl_mock);
48  $this->setGlobalVariable("tpl", $this->createMock(ilGlobalPageTemplate::class));
49  $this->setGlobalVariable("component.repository", $this->createMock(ilComponentRepository::class));
50  $component_factory = $this->createMock(ilComponentFactory::class);
51  $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
52  $this->setGlobalVariable("component.factory", $component_factory);
53  $this->setGlobalVariable("ilDB", $this->createMock(ilDBInterface::class));
54 
55  $this->parentObj_mock = $this->getMockBuilder(ilObjTestGUI::class)->disableOriginalConstructor()->onlyMethods(array('getObject'))->getMock();
56  $this->parentObj_mock->expects($this->any())->method('getObject')->willReturn($this->createMock(ilObjTest::class));
58  $ctrl_mock,
59  $lng_mock,
60  $this->parentObj_mock,
61  "",
62  $this->createMock(ilAccess::class),
63  $this->createMock(ILIAS\UI\Factory::class),
64  $this->createMock(ILIAS\UI\Renderer::class),
65  [],
66  []
67  );
68  }
69 
71  {
72  $this->assertInstanceOf(ilTestRandomQuestionSetSourcePoolDefinitionListTableGUI::class, $this->tableGui);
73  }
74 
75  public function testDefinitionEditModeEnabled(): void
76  {
77  $this->assertIsBool($this->tableGui->isDefinitionEditModeEnabled());
78  $this->tableGui->setDefinitionEditModeEnabled(false);
79  $this->assertFalse($this->tableGui->isDefinitionEditModeEnabled());
80  $this->tableGui->setDefinitionEditModeEnabled(true);
81  $this->assertTrue($this->tableGui->isDefinitionEditModeEnabled());
82  }
83 
84  public function testQuestionAmountColumnEnabled(): void
85  {
86  $this->assertIsBool($this->tableGui->isQuestionAmountColumnEnabled());
87  $this->tableGui->setQuestionAmountColumnEnabled(false);
88  $this->assertFalse($this->tableGui->isQuestionAmountColumnEnabled());
89  $this->tableGui->setQuestionAmountColumnEnabled(true);
90  $this->assertTrue($this->tableGui->isQuestionAmountColumnEnabled());
91  }
92 }
Class Factory.
Class ilObjTestGUI.
Class ChatMainBarProvider .
setGlobalVariable(string $name, $value)
Class ilTestBaseClass.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...