ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
assAnswerOrderingTest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3require_once 'Services/Database/interfaces/interface.ilDBInterface.php';
12{
13 protected $backupGlobals = FALSE;
14
15 protected function setUp()
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 }
28
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 }
39
40 public function test_setGetRandomId()
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 }
54
55 public function test_setGetAnswerId()
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 }
69
70
71 public function test_setGetOrdeingDepth()
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 }
85}
An exception for terminatinating execution or to throw for unit testing.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27