ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestRandomQuestionSetConfigTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTestRandomQuestionSetConfigTest:
+ Collaboration diagram for ilTestRandomQuestionSetConfigTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 testPoolsWithHomogeneousScoredQuestionsRequired ()
 
 testQuestionAmountConfigurationMode ()
 
 testQuestionAmountConfigurationModePerPool ()
 
 testQuestionAmountConfigurationModePerTest ()
 
 testIsValidQuestionAmountConfigurationMode ()
 
 testQuestionAmountPerTest ()
 
 testLastQuestionSyncTimestamp ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 

Private Attributes

ilTestRandomQuestionSetConfig $testObj
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTestBaseTestCase
static callMethod ($obj, $name, array $args=[])
 
- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilTestRandomQuestionSetConfigTest

Author
Marvin Beym mbeym.nosp@m.@dat.nosp@m.abay..nosp@m.de

Definition at line 23 of file ilTestRandomQuestionSetConfigTest.php.

Member Function Documentation

◆ setUp()

ilTestRandomQuestionSetConfigTest::setUp ( )
protected

Definition at line 27 of file ilTestRandomQuestionSetConfigTest.php.

27  : void
28  {
29  parent::setUp();
30 
31  $this->testObj = new ilTestRandomQuestionSetConfig(
32  $this->getMockBuilder(ilTree::class)->disableOriginalConstructor()->getMock(),
33  $this->createMock(ilDBInterface::class),
34  $this->createMock(ilLanguage::class),
35  $this->createMock(ILIAS\Test\Logging\TestLogger::class),
36  $this->createMock(ilComponentRepository::class),
37  $this->getMockBuilder(ilObjTest::class)->disableOriginalConstructor()->getMock(),
38  $this->getMockBuilder(\ILIAS\TestQuestionPool\Questions\GeneralQuestionPropertiesRepository::class)->disableOriginalConstructor()->getMock()
39  );
40  }
Interface Observer Contains several chained tasks and infos about them.

◆ test_instantiateObject_shouldReturnInstance()

ilTestRandomQuestionSetConfigTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 42 of file ilTestRandomQuestionSetConfigTest.php.

42  : void
43  {
44  $this->assertInstanceOf(ilTestRandomQuestionSetConfig::class, $this->testObj);
45  }

◆ testIsValidQuestionAmountConfigurationMode()

ilTestRandomQuestionSetConfigTest::testIsValidQuestionAmountConfigurationMode ( )

Definition at line 81 of file ilTestRandomQuestionSetConfigTest.php.

References ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_POOL, and ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_TEST.

81  : void
82  {
83  $this->assertFalse($this->testObj->isValidQuestionAmountConfigurationMode(200));
84  $this->assertTrue($this->testObj->isValidQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL));
85  $this->assertTrue($this->testObj->isValidQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST));
86  }

◆ testLastQuestionSyncTimestamp()

ilTestRandomQuestionSetConfigTest::testLastQuestionSyncTimestamp ( )

Definition at line 95 of file ilTestRandomQuestionSetConfigTest.php.

95  : void
96  {
97  $lastQuestionSyncTimestamp = 222;
98  $this->testObj->setLastQuestionSyncTimestamp($lastQuestionSyncTimestamp);
99  $this->assertEquals($lastQuestionSyncTimestamp, $this->testObj->getLastQuestionSyncTimestamp());
100  }

◆ testPoolsWithHomogeneousScoredQuestionsRequired()

ilTestRandomQuestionSetConfigTest::testPoolsWithHomogeneousScoredQuestionsRequired ( )

Definition at line 47 of file ilTestRandomQuestionSetConfigTest.php.

47  : void
48  {
49  $this->testObj->setPoolsWithHomogeneousScoredQuestionsRequired(false);
50  $this->assertFalse($this->testObj->arePoolsWithHomogeneousScoredQuestionsRequired());
51 
52  $this->testObj->setPoolsWithHomogeneousScoredQuestionsRequired(true);
53  $this->assertTrue($this->testObj->arePoolsWithHomogeneousScoredQuestionsRequired());
54  }

◆ testQuestionAmountConfigurationMode()

ilTestRandomQuestionSetConfigTest::testQuestionAmountConfigurationMode ( )

Definition at line 56 of file ilTestRandomQuestionSetConfigTest.php.

56  : void
57  {
58  $questionAmountConfigurationMode = 'test';
59  $this->testObj->setQuestionAmountConfigurationMode($questionAmountConfigurationMode);
60  $this->assertEquals($questionAmountConfigurationMode, $this->testObj->getQuestionAmountConfigurationMode());
61  }

◆ testQuestionAmountConfigurationModePerPool()

ilTestRandomQuestionSetConfigTest::testQuestionAmountConfigurationModePerPool ( )

Definition at line 63 of file ilTestRandomQuestionSetConfigTest.php.

References ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_POOL, and ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_TEST.

63  : void
64  {
65  $this->testObj->setQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST);
66  $this->assertFalse($this->testObj->isQuestionAmountConfigurationModePerPool());
67 
68  $this->testObj->setQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL);
69  $this->assertTrue($this->testObj->isQuestionAmountConfigurationModePerPool());
70  }

◆ testQuestionAmountConfigurationModePerTest()

ilTestRandomQuestionSetConfigTest::testQuestionAmountConfigurationModePerTest ( )

Definition at line 72 of file ilTestRandomQuestionSetConfigTest.php.

References ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_POOL, and ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_TEST.

72  : void
73  {
74  $this->testObj->setQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_POOL);
75  $this->assertFalse($this->testObj->isQuestionAmountConfigurationModePerTest());
76 
77  $this->testObj->setQuestionAmountConfigurationMode(ilTestRandomQuestionSetConfig::QUESTION_AMOUNT_CONFIG_MODE_PER_TEST);
78  $this->assertTrue($this->testObj->isQuestionAmountConfigurationModePerTest());
79  }

◆ testQuestionAmountPerTest()

ilTestRandomQuestionSetConfigTest::testQuestionAmountPerTest ( )

Definition at line 88 of file ilTestRandomQuestionSetConfigTest.php.

88  : void
89  {
90  $questionAmountPerTest = 222;
91  $this->testObj->setQuestionAmountPerTest($questionAmountPerTest);
92  $this->assertEquals($questionAmountPerTest, $this->testObj->getQuestionAmountPerTest());
93  }

Field Documentation

◆ $testObj

ilTestRandomQuestionSetConfig ilTestRandomQuestionSetConfigTest::$testObj
private

Definition at line 25 of file ilTestRandomQuestionSetConfigTest.php.


The documentation for this class was generated from the following file: