ILIAS  release_7 Revision v7.30-3-g800a261c036
assAnswerOrderingTest Class Reference

Unit tests. More...

+ Inheritance diagram for assAnswerOrderingTest:
+ Collaboration diagram for assAnswerOrderingTest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 
 test_setGetRandomId ()
 
 test_setGetAnswerId ()
 
 test_setGetOrdeingDepth ()
 

Protected Member Functions

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

Protected Attributes

 $backupGlobals = false
 

Detailed Description

Unit tests.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 10 of file assAnswerOrderingTest.php.

Member Function Documentation

◆ setUp()

assAnswerOrderingTest::setUp ( )
protected

Reimplemented from assBaseTestCase.

Definition at line 14 of file assAnswerOrderingTest.php.

14 : void
15 {
16 if (defined('ILIAS_PHPUNIT_CONTEXT')) {
17 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
18 ilUnitUtil::performInitialisation();
19 } else {
20 chdir(dirname(__FILE__));
21 chdir('../../../');
22 }
23 }

◆ test_instantiateObject_shouldReturnInstance()

assAnswerOrderingTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 25 of file assAnswerOrderingTest.php.

26 {
27 // Arrange
28 require_once './Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElement.php';
29
30 // Act
31 $instance = new ilAssOrderingElement();
32
33 $this->assertInstanceOf('ilAssOrderingElement', $instance);
34 }

◆ test_setGetAnswerId()

assAnswerOrderingTest::test_setGetAnswerId ( )

Definition at line 51 of file assAnswerOrderingTest.php.

52 {
53 // Arrange
54 require_once './Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElement.php';
55 $instance = new ilAssOrderingElement();
56 $expected = 13579;
57
58 // Act
59 $instance->setId($expected);
60 $actual = $instance->getId();
61
62 // Assert
63 $this->assertEquals($expected, $actual);
64 }

◆ test_setGetOrdeingDepth()

assAnswerOrderingTest::test_setGetOrdeingDepth ( )

Definition at line 67 of file assAnswerOrderingTest.php.

68 {
69 // Arrange
70 require_once './Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElement.php';
71 $instance = new ilAssOrderingElement();
72 $expected = 13579;
73
74 // Act
75 $instance->setIndentation($expected);
76 $actual = $instance->getIndentation();
77
78 // Assert
79 $this->assertEquals($expected, $actual);
80 }

◆ test_setGetRandomId()

assAnswerOrderingTest::test_setGetRandomId ( )

Definition at line 36 of file assAnswerOrderingTest.php.

37 {
38 // Arrange
39 require_once './Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElement.php';
40 $instance = new ilAssOrderingElement();
41 $expected = 13579;
42
43 // Act
44 $instance->setRandomIdentifier($expected);
45 $actual = $instance->getRandomIdentifier();
46
47 // Assert
48 $this->assertEquals($expected, $actual);
49 }

Field Documentation

◆ $backupGlobals

assAnswerOrderingTest::$backupGlobals = false
protected

Definition at line 12 of file assAnswerOrderingTest.php.


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