ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 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 11 of file assAnswerOrderingTest.php.

Member Function Documentation

◆ setUp()

assAnswerOrderingTest::setUp ( )
protected

Definition at line 15 of file assAnswerOrderingTest.php.

16 {
17 if (defined('ILIAS_PHPUNIT_CONTEXT')) {
18 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
19 ilUnitUtil::performInitialisation();
20 } else {
21 chdir(dirname(__FILE__));
22 chdir('../../../');
23 }
24 }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

References defined.

◆ test_instantiateObject_shouldReturnInstance()

assAnswerOrderingTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 26 of file assAnswerOrderingTest.php.

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

◆ test_setGetAnswerId()

assAnswerOrderingTest::test_setGetAnswerId ( )

Definition at line 52 of file assAnswerOrderingTest.php.

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

◆ test_setGetOrdeingDepth()

assAnswerOrderingTest::test_setGetOrdeingDepth ( )

Definition at line 68 of file assAnswerOrderingTest.php.

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

◆ test_setGetRandomId()

assAnswerOrderingTest::test_setGetRandomId ( )

Definition at line 37 of file assAnswerOrderingTest.php.

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

Field Documentation

◆ $backupGlobals

assAnswerOrderingTest::$backupGlobals = false
protected

Definition at line 13 of file assAnswerOrderingTest.php.


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