ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
assAnswerMatchingTermTest.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.assAnswerMatchingTerm.php';
33 
34  // Act
35  $instance = new assAnswerMatchingTerm();
36 
37  // Assert
38  $this->assertInstanceOf('assAnswerMatchingTerm', $instance);
39  }
40 
41  public function test_setGetText()
42  {
43  // Arrange
44  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
45  $instance = new assAnswerMatchingTerm();
46  $expected = 'Text';
47 
48  // Act
49  $instance->text = $expected;
50  $actual = $instance->text;
51 
52  // Assert
53  $this->assertEquals($expected, $actual);
54  }
55 
56  public function test_setGetPicture()
57  {
58  // Arrange
59  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
60  $instance = new assAnswerMatchingTerm();
61  $expected = 'path/to/picture?';
62 
63  // Act
64  $instance->picture = $expected;
65  $actual = $instance->picture;
66 
67  // Assert
68  $this->assertEquals($expected, $actual);
69  }
70 
71  public function test_getUnsetPicture()
72  {
73  // Arrange
74  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
75  $instance = new assAnswerMatchingTerm();
76  $expected = null;
77 
78  // Act
79  $actual = $instance->picture;
80 
81  // Assert
82  $this->assertEquals($expected, $actual);
83  }
84 
85  public function test_setGetIdentifier()
86  {
87  // Arrange
88  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
89  $instance = new assAnswerMatchingTerm();
90  $expected = 12345;
91 
92  // Act
93  $instance->identifier = $expected;
94  $actual = $instance->identifier;
95 
96  // Assert
97  $this->assertEquals($expected, $actual);
98  }
99 
100  public function test_setGetHokum()
101  {
102  // Arrange
103  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
104  $instance = new assAnswerMatchingTerm();
105  $expected = null;
106 
107  // Act
108  $instance->hokum = 'Hokum Value';
109  $actual = $instance->hokum;
110 
111  // Assert
112  $this->assertEquals($expected, $actual);
113  }
114 }