ILIAS  release_8 Revision v8.23
assAnswerOrderingTest.php
Go to the documentation of this file.
1 <?php
2 
27 {
28  protected $backupGlobals = false;
29 
30  protected function setUp(): void
31  {
32  chdir(dirname(__FILE__));
33  chdir('../../../');
34  }
35 
37  {
38  // Arrange
39  require_once './Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElement.php';
40 
41  // Act
42  $instance = new ilAssOrderingElement();
43 
44  $this->assertInstanceOf('ilAssOrderingElement', $instance);
45  }
46 
47  public function test_setGetRandomId(): void
48  {
49  // Arrange
50  require_once './Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElement.php';
51  $instance = new ilAssOrderingElement();
52  $expected = 13579;
53 
54  // Act
55  $instance->setRandomIdentifier($expected);
56  $actual = $instance->getRandomIdentifier();
57 
58  // Assert
59  $this->assertEquals($expected, $actual);
60  }
61 
62  public function test_setGetAnswerId(): void
63  {
64  // Arrange
65  require_once './Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElement.php';
66  $instance = new ilAssOrderingElement();
67  $expected = 13579;
68 
69  // Act
70  $instance->setId($expected);
71  $actual = $instance->getId();
72 
73  // Assert
74  $this->assertEquals($expected, $actual);
75  }
76 
77 
78  public function test_setGetOrdeingDepth(): void
79  {
80  // Arrange
81  require_once './Modules/TestQuestionPool/classes/questions/class.ilAssOrderingElement.php';
82  $instance = new ilAssOrderingElement();
83  $expected = 13579;
84 
85  // Act
86  $instance->setIndentation($expected);
87  $actual = $instance->getIndentation();
88 
89  // Assert
90  $this->assertEquals($expected, $actual);
91  }
92 }
Class assBaseTestCase.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...