ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
assAnswerOrderingTest.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
11 {
12  protected $backupGlobals = false;
13 
14  protected function setUp() : 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  }
24 
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  }
35 
36  public function test_setGetRandomId()
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  }
50 
51  public function test_setGetAnswerId()
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  }
65 
66 
67  public function test_setGetOrdeingDepth()
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  }
81 }
Class assBaseTestCase.