ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  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.assAnswerMatchingTerm.php';
30 
31  // Act
32  $instance = new assAnswerMatchingTerm();
33 
34  // Assert
35  $this->assertInstanceOf('assAnswerMatchingTerm', $instance);
36  }
37 
38  public function test_setGetText()
39  {
40  // Arrange
41  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
42  $instance = new assAnswerMatchingTerm();
43  $expected = 'Text';
44 
45  // Act
46  $instance->text = $expected;
47  $actual = $instance->text;
48 
49  // Assert
50  $this->assertEquals($expected, $actual);
51  }
52 
53  public function test_setGetPicture()
54  {
55  // Arrange
56  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
57  $instance = new assAnswerMatchingTerm();
58  $expected = 'path/to/picture?';
59 
60  // Act
61  $instance->picture = $expected;
62  $actual = $instance->picture;
63 
64  // Assert
65  $this->assertEquals($expected, $actual);
66  }
67 
68  public function test_getUnsetPicture()
69  {
70  // Arrange
71  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
72  $instance = new assAnswerMatchingTerm();
73  $expected = null;
74 
75  // Act
76  $actual = $instance->picture;
77 
78  // Assert
79  $this->assertEquals($expected, $actual);
80  }
81 
82  public function test_setGetIdentifier()
83  {
84  // Arrange
85  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
86  $instance = new assAnswerMatchingTerm();
87  $expected = 12345;
88 
89  // Act
90  $instance->identifier = $expected;
91  $actual = $instance->identifier;
92 
93  // Assert
94  $this->assertEquals($expected, $actual);
95  }
96 
97  public function test_setGetHokum()
98  {
99  // Arrange
100  require_once './Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
101  $instance = new assAnswerMatchingTerm();
102  $expected = null;
103 
104  // Act
105  $instance->hokum = 'Hokum Value';
106  $actual = $instance->hokum;
107 
108  // Assert
109  $this->assertEquals($expected, $actual);
110  }
111 }
Class for matching question terms.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27