ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
assAnswerMultipleResponseTest.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.assAnswerMultipleResponse.php';
33 
34  // Act
35  $instance = new ASS_AnswerMultipleResponse();
36 
37  // Assert
38  $this->assertInstanceOf('ASS_AnswerMultipleResponse', $instance);
39  }
40 
41  public function test_setGetPointsUnchecked()
42  {
43  // Arrange
44  require_once './Modules/TestQuestionPool/classes/class.assAnswerMultipleResponse.php';
45  $instance = new ASS_AnswerMultipleResponse();
46  $expected = 1;
47 
48  // Act
49  $instance->setPointsUnchecked($expected);
50  $actual = $instance->getPointsUnchecked();
51 
52  // Assert
53  $this->assertEquals($expected, $actual);
54  }
55 
57  {
58  // Arrange
59  require_once './Modules/TestQuestionPool/classes/class.assAnswerMultipleResponse.php';
60  $instance = new ASS_AnswerMultipleResponse();
61  $expected = 0;
62 
63  // Act
64  $instance->setPointsUnchecked('Günther');
65  $actual = $instance->getPointsUnchecked();
66 
67  // Assert
68  $this->assertEquals($expected, $actual);
69  }
70 
71  public function test_setGetPointsChecked()
72  {
73  // Arrange
74  require_once './Modules/TestQuestionPool/classes/class.assAnswerMultipleResponse.php';
75  $instance = new ASS_AnswerMultipleResponse();
76  $expected = 2;
77 
78  // Act
79  $instance->setPointsChecked($expected);
80  $actual = $instance->getPointsChecked();
81 
82  // Assert
83  $this->assertEquals($expected, $actual);
84  }
85 }