ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestRandomQuestionSetSourcePoolDefinitionListTableGUITest.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  $this->addGlobal_lng();
35  $this->addGlobal_tpl();
37 
38  $ctrl_mock = $this->createMock(ilCtrl::class);
39  $ctrl_mock->expects($this->any())
40  ->method("getFormAction")
41  ->willReturnCallback(function () {
42  return "testFormAction";
43  });
44  $this->setGlobalVariable("ilCtrl", $ctrl_mock);
45  ;
46  $component_factory = $this->createMock(ilComponentFactory::class);
47  $component_factory->method("getActivePluginsInSlot")->willReturn(new ArrayIterator());
48  $this->setGlobalVariable("component.factory", $component_factory);
49 
50  $this->parentObj_mock = $this->createMock(ilTestRandomQuestionSetConfigGUI::class);
52  $this->parentObj_mock,
53  "",
54  $this->createMock(ilAccess::class),
55  $this->createMock(ILIAS\UI\Factory::class),
56  $this->createMock(ILIAS\UI\Renderer::class),
57  [],
58  []
59  );
60  }
61 
63  {
64  $this->assertInstanceOf(ilTestRandomQuestionSetSourcePoolDefinitionListTableGUI::class, $this->tableGui);
65  }
66 
67  public function testDefinitionEditModeEnabled(): void
68  {
69  $this->assertIsBool($this->tableGui->isDefinitionEditModeEnabled());
70  $this->tableGui->setDefinitionEditModeEnabled(false);
71  $this->assertFalse($this->tableGui->isDefinitionEditModeEnabled());
72  $this->tableGui->setDefinitionEditModeEnabled(true);
73  $this->assertTrue($this->tableGui->isDefinitionEditModeEnabled());
74  }
75 
76  public function testQuestionAmountColumnEnabled(): void
77  {
78  $this->assertIsBool($this->tableGui->isQuestionAmountColumnEnabled());
79  $this->tableGui->setQuestionAmountColumnEnabled(false);
80  $this->assertFalse($this->tableGui->isQuestionAmountColumnEnabled());
81  $this->tableGui->setQuestionAmountColumnEnabled(true);
82  $this->assertTrue($this->tableGui->isQuestionAmountColumnEnabled());
83  }
84 }
Class ChatMainBarProvider .
setGlobalVariable(string $name, $value)
Class ilTestBaseClass.