ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
19  ilUnitUtil::performInitialisation();
20  } else {
21  chdir(dirname(__FILE__));
22  chdir('../../../');
23  }
24  }
25 
26  public function test_instantiateObjectSimple()
27  {
28  // Arrange
29  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
30 
31  // Act
32  $instance = new assAnswerMatchingPair();
33 
34  // Assert
35  $this->assertInstanceOf('assAnswerMatchingPair', $instance);
36  }
37 
38  public function test_setGetTerm()
39  {
40  // Arrange
41  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
42  $instance = new assAnswerMatchingPair();
43  $expected = 'Term';
44 
45  // Act
46  $instance->term = $expected;
47  $actual = $instance->term;
48 
49  // Assert
50  $this->assertEquals($expected, $actual);
51  }
52 
53  public function test_setGetDefinition()
54  {
55  // Arrange
56  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
57  $instance = new assAnswerMatchingPair();
58  $expected = 'Definition';
59 
60  // Act
61  $instance->definition = $expected;
62  $actual = $instance->definition;
63 
64  // Assert
65  $this->assertEquals($expected, $actual);
66  }
67 
68  public function test_setGetPoints()
69  {
70  // Arrange
71  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
72  $instance = new assAnswerMatchingPair();
73  $expected = 'Definition';
74 
75  // Act
76  $instance->points = $expected;
77  $actual = $instance->points;
78 
79  // Assert
80  $this->assertEquals($expected, $actual);
81  }
82 
83  public function test_setGetHokum()
84  {
85  // Arrange
86  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
87  $instance = new assAnswerMatchingPair();
88  $expected = null;
89 
90  // Act
91  $instance->hokum = 'Hokum Value';
92  $actual = $instance->hokum;
93 
94  // Assert
95  $this->assertEquals($expected, $actual);
96  }
97 }
Class for matching question pairs.