ILIAS  release_8 Revision v8.23
assKprimChoiceTest 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 assKprimChoiceTest:
+ Collaboration diagram for assKprimChoiceTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 test_getQuestionType_shouldReturnQuestionType ()
 
 test_getAdditionalTableName_shouldReturnAdditionalTableName ()
 
 test_getAnswerTableName_shouldReturnAnswerTableName ()
 
 test_isValidOptionLabel_shouldReturnTrue ()
 
 test_isObligationPossible_shouldReturnTrue ()
 
 test_isValidAnswerType_shouldReturnTrue ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from assBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 

Protected Attributes

 $backupGlobals = false
 
- Protected Attributes inherited from assBaseTestCase
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 Unit tests

Author
Guido Vollbach <gvollbachdatabay.de>

Definition at line 25 of file assKprimChoiceTest.php.

Member Function Documentation

◆ setUp()

assKprimChoiceTest::setUp ( )
protected

Definition at line 29 of file assKprimChoiceTest.php.

References assBaseTestCase\getGlobalTemplateMock(), assBaseTestCase\getIliasMock(), and assBaseTestCase\setGlobalVariable().

29  : void
30  {
31  parent::setUp();
32  $this->setGlobalVariable('ilias', $this->getIliasMock());
33  $this->setGlobalVariable('tpl', $this->getGlobalTemplateMock());
34  }
setGlobalVariable(string $name, $value)
+ Here is the call graph for this function:

◆ test_getAdditionalTableName_shouldReturnAdditionalTableName()

assKprimChoiceTest::test_getAdditionalTableName_shouldReturnAdditionalTableName ( )

Definition at line 48 of file assKprimChoiceTest.php.

48  : void
49  {
50  $obj = new assKprimChoice();
51  $this->assertEquals('qpl_qst_kprim', $obj->getAdditionalTableName());
52  }

◆ test_getAnswerTableName_shouldReturnAnswerTableName()

assKprimChoiceTest::test_getAnswerTableName_shouldReturnAnswerTableName ( )

Definition at line 54 of file assKprimChoiceTest.php.

54  : void
55  {
56  $obj = new assKprimChoice();
57  $this->assertEquals('qpl_a_kprim', $obj->getAnswerTableName());
58  }

◆ test_getQuestionType_shouldReturnQuestionType()

assKprimChoiceTest::test_getQuestionType_shouldReturnQuestionType ( )

Definition at line 42 of file assKprimChoiceTest.php.

42  : void
43  {
44  $obj = new assKprimChoice();
45  $this->assertEquals('assKprimChoice', $obj->getQuestionType());
46  }

◆ test_instantiateObject_shouldReturnInstance()

assKprimChoiceTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 36 of file assKprimChoiceTest.php.

36  : void
37  {
38  $instance = new assKprimChoice();
39  $this->assertInstanceOf('assKprimChoice', $instance);
40  }

◆ test_isObligationPossible_shouldReturnTrue()

assKprimChoiceTest::test_isObligationPossible_shouldReturnTrue ( )

Definition at line 99 of file assKprimChoiceTest.php.

99  : void
100  {
101  $obj = new assKprimChoice();
102  $this->assertEquals(true, $obj->isObligationPossible(1));
103  }

◆ test_isValidAnswerType_shouldReturnTrue()

assKprimChoiceTest::test_isValidAnswerType_shouldReturnTrue ( )

Definition at line 117 of file assKprimChoiceTest.php.

117  : void
118  {
119  $obj = new assKprimChoice();
120  $this->assertEquals(false, $obj->isValidAnswerType('not valid'));
121  $this->assertEquals(true, $obj->isValidAnswerType($obj::ANSWER_TYPE_SINGLE_LINE));
122  }

◆ test_isValidOptionLabel_shouldReturnTrue()

assKprimChoiceTest::test_isValidOptionLabel_shouldReturnTrue ( )

Definition at line 92 of file assKprimChoiceTest.php.

92  : void
93  {
94  $obj = new assKprimChoice();
95  $this->assertEquals(false, $obj->isValidOptionLabel('not valid'));
96  $this->assertEquals(true, $obj->isValidOptionLabel($obj::OPTION_LABEL_RIGHT_WRONG));
97  }

Field Documentation

◆ $backupGlobals

assKprimChoiceTest::$backupGlobals = false
protected

Definition at line 27 of file assKprimChoiceTest.php.


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