ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestRandomQuestionSetConfigStateMessageHandlerTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
28 
29  protected function setUp(): void
30  {
31  global $DIC;
32  parent::setUp();
33  $this->addGlobal_ilUser();
34  $this->addGlobal_ilCtrl();
35  $this->addGlobal_uiFactory();
36  $this->addGlobal_uiRenderer();
37 
38 
40  $DIC['lng'],
41  $DIC['ui.factory'],
42  $DIC['ui.renderer'],
43  $DIC['ilCtrl']
44  );
45  }
46 
48  {
49  $this->assertInstanceOf(ilTestRandomQuestionSetConfigStateMessageHandler::class, $this->testObj);
50  }
51 
52  public function testLostPools(): void
53  {
54  $expected = [
58  ];
59 
60  $this->testObj->setLostPools($expected);
61  $this->assertEquals($expected, $this->testObj->getLostPools());
62  }
63 
64  public function testParticipantDataExists(): void
65  {
66  $this->testObj->setParticipantDataExists(false);
67  $this->assertFalse($this->testObj->doesParticipantDataExists());
68 
69  $this->testObj->setParticipantDataExists(true);
70  $this->assertTrue($this->testObj->doesParticipantDataExists());
71  }
72 
73  public function testTargetGUI(): void
74  {
75  $targetGui_mock = $this->createMock(ilTestRandomQuestionSetConfigGUI::class);
76  $this->testObj->setTargetGUI($targetGui_mock);
77  $this->assertEquals($targetGui_mock, $this->testObj->getTargetGUI());
78  }
79 
80  public function testContext(): void
81  {
82  $this->testObj->setContext("test");
83  $this->assertEquals("test", $this->testObj->getContext());
84  }
85 
86  public function testQuestionSetConfig(): void
87  {
88  $mock = $this->createMock(ilTestRandomQuestionSetConfig::class);
89  $this->testObj->setQuestionSetConfig($mock);
90  $this->assertEquals($mock, $this->testObj->getQuestionSetConfig());
91  }
92 }
global $DIC
Definition: feed.php:28
Class ilTestBaseClass.