ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
assAnswerMatchingPairTest.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
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 
29  public function test_instantiateObjectSimple()
30  {
31  // Arrange
32  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
33 
34  // Act
35  $instance = new assAnswerMatchingPair();
36 
37  // Assert
38  $this->assertInstanceOf('assAnswerMatchingPair', $instance);
39  }
40 
41  public function test_setGetTerm()
42  {
43  // Arrange
44  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
45  $instance = new assAnswerMatchingPair();
46  $expected = 'Term';
47 
48  // Act
49  $instance->term = $expected;
50  $actual = $instance->term;
51 
52  // Assert
53  $this->assertEquals($expected, $actual);
54  }
55 
56  public function test_setGetDefinition()
57  {
58  // Arrange
59  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
60  $instance = new assAnswerMatchingPair();
61  $expected = 'Definition';
62 
63  // Act
64  $instance->definition = $expected;
65  $actual = $instance->definition;
66 
67  // Assert
68  $this->assertEquals($expected, $actual);
69  }
70 
71  public function test_setGetPoints()
72  {
73  // Arrange
74  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
75  $instance = new assAnswerMatchingPair();
76  $expected = 'Definition';
77 
78  // Act
79  $instance->points = $expected;
80  $actual = $instance->points;
81 
82  // Assert
83  $this->assertEquals($expected, $actual);
84  }
85 
86  public function test_setGetHokum()
87  {
88  // Arrange
89  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
90  $instance = new assAnswerMatchingPair();
91  $expected = null;
92 
93  // Act
94  $instance->hokum = 'Hokum Value';
95  $actual = $instance->hokum;
96 
97  // Assert
98  $this->assertEquals($expected, $actual);
99  }
100 
101 
102 }