ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 {
19 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
20 ilUnitUtil::performInitialisation();
21 }
22 else
23 {
24 chdir( dirname( __FILE__ ) );
25 chdir('../../../');
26 }
27 }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

References defined.

◆ test_instantiateObject_shouldReturnInstance()

assAnswerOrderingTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 29 of file assAnswerOrderingTest.php.

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

◆ test_setGetAnswerId()

assAnswerOrderingTest::test_setGetAnswerId ( )

Definition at line 55 of file assAnswerOrderingTest.php.

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

◆ test_setGetOrdeingDepth()

assAnswerOrderingTest::test_setGetOrdeingDepth ( )

Definition at line 71 of file assAnswerOrderingTest.php.

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

◆ test_setGetRandomId()

assAnswerOrderingTest::test_setGetRandomId ( )

Definition at line 40 of file assAnswerOrderingTest.php.

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

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: