ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestRandomQuestionSetConfigTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
26 {
28 
29  protected function setUp(): void
30  {
31  parent::setUp();
32 
33  $this->testObj = new ilTestRandomQuestionSetConfig(
34  $this->getMockBuilder(ilTree::class)->disableOriginalConstructor()->getMock(),
35  $this->createMock(ilDBInterface::class),
36  $this->createMock(ilComponentRepository::class),
37  $this->getMockBuilder(ilObjTest::class)->disableOriginalConstructor()->getMock()
38  );
39  }
40 
42  {
43  $this->assertInstanceOf(ilTestRandomQuestionSetConfig::class, $this->testObj);
44  }
45 
47  {
48  $this->testObj->setPoolsWithHomogeneousScoredQuestionsRequired(false);
49  $this->assertFalse($this->testObj->arePoolsWithHomogeneousScoredQuestionsRequired());
50 
51  $this->testObj->setPoolsWithHomogeneousScoredQuestionsRequired(true);
52  $this->assertTrue($this->testObj->arePoolsWithHomogeneousScoredQuestionsRequired());
53  }
54 
55  public function testQuestionAmountConfigurationMode(): void
56  {
57  $this->testObj->setQuestionAmountConfigurationMode("test");
58  $this->assertEquals("test", $this->testObj->getQuestionAmountConfigurationMode());
59  }
60 
62  {
63  $this->testObj->setQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST);
64  $this->assertFalse($this->testObj->isQuestionAmountConfigurationModePerPool());
65 
66  $this->testObj->setQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL);
67  $this->assertTrue($this->testObj->isQuestionAmountConfigurationModePerPool());
68  }
69 
71  {
72  $this->testObj->setQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL);
73  $this->assertFalse($this->testObj->isQuestionAmountConfigurationModePerTest());
74 
75  $this->testObj->setQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST);
76  $this->assertTrue($this->testObj->isQuestionAmountConfigurationModePerTest());
77  }
78 
80  {
81  $this->assertFalse($this->testObj->isValidQuestionAmountConfigurationMode(200));
82  $this->assertTrue($this->testObj->isValidQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL));
83  $this->assertTrue($this->testObj->isValidQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST));
84  }
85 
86  public function testQuestionAmountPerTest(): void
87  {
88  $this->testObj->setQuestionAmountPerTest(222);
89  $this->assertEquals(222, $this->testObj->getQuestionAmountPerTest());
90  }
91 
92  public function testLastQuestionSyncTimestamp(): void
93  {
94  $this->testObj->setLastQuestionSyncTimestamp(222);
95  $this->assertEquals(222, $this->testObj->getLastQuestionSyncTimestamp());
96  }
97 }
Class ilTestBaseClass.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...