ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
assMultipleChoiceGUITest Class Reference

Unit tests for single choice questions. More...

+ Inheritance diagram for assMultipleChoiceGUITest:
+ Collaboration diagram for assMultipleChoiceGUITest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from assBaseTestCase
 setUp ()
 
 setGlobalVariable ($name, $value)
 
 getGlobalTemplateMock ()
 
 getDatabaseMock ()
 
 getIliasMock ()
 

Protected Attributes

 $backupGlobals = false
 

Detailed Description

Unit tests for single choice questions.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
Id
assMultipleChoiceTest.php 35946 2012-08-02 21:48:44Z mbecker

Definition at line 13 of file assMultipleChoiceGUITest.php.

Member Function Documentation

◆ setUp()

assMultipleChoiceGUITest::setUp ( )
protected

Definition at line 17 of file assMultipleChoiceGUITest.php.

References assBaseTestCase\getDatabaseMock(), assBaseTestCase\getGlobalTemplateMock(), assBaseTestCase\getIliasMock(), and assBaseTestCase\setGlobalVariable().

18  {
19  if (defined('ILIAS_PHPUNIT_CONTEXT')) {
20  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
21  ilUnitUtil::performInitialisation();
22  } else {
23  chdir(dirname(__FILE__));
24  chdir('../../../');
25 
26  parent::setUp();
27 
28  require_once './Services/UICore/classes/class.ilCtrl.php';
29  $ilCtrl_mock = $this->createMock('ilCtrl');
30  $ilCtrl_mock->expects($this->any())->method('saveParameter');
31  $ilCtrl_mock->expects($this->any())->method('saveParameterByClass');
32  $this->setGlobalVariable('ilCtrl', $ilCtrl_mock);
33 
34  require_once './Services/Language/classes/class.ilLanguage.php';
35  $lng_mock = $this->createMock('ilLanguage', array('txt'), array(), '', false);
36  //$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
37  $this->setGlobalVariable('lng', $lng_mock);
38 
39  $this->setGlobalVariable('ilias', $this->getIliasMock());
40  $this->setGlobalVariable('tpl', $this->getGlobalTemplateMock());
41  $this->setGlobalVariable('ilDB', $this->getDatabaseMock());
42  }
43  }
setGlobalVariable($name, $value)
+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

assMultipleChoiceGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 45 of file assMultipleChoiceGUITest.php.

46  {
47  // Arrange
48  require_once './Modules/TestQuestionPool/classes/class.assMultipleChoiceGUI.php';
49 
50  // Act
51  $instance = new assMultipleChoiceGUI();
52 
53  $this->assertInstanceOf('assMultipleChoiceGUI', $instance);
54  }
Multiple choice question GUI representation.

Field Documentation

◆ $backupGlobals

assMultipleChoiceGUITest::$backupGlobals = false
protected

Definition at line 15 of file assMultipleChoiceGUITest.php.


The documentation for this class was generated from the following file: