ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
assSingleChoiceGUITest Class Reference

Unit tests for single choice questions. More...

+ Inheritance diagram for assSingleChoiceGUITest:
+ Collaboration diagram for assSingleChoiceGUITest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 

Protected Member Functions

 setUp ()
 

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
assSingleChoiceTest.php 35946 2012-08-02 21:48:44Z mbecker

Definition at line 13 of file assSingleChoiceGUITest.php.

Member Function Documentation

◆ setUp()

assSingleChoiceGUITest::setUp ( )
protected

Definition at line 17 of file assSingleChoiceGUITest.php.

References $ilCtrl, $lng, array, and defined.

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  require_once './Services/UICore/classes/class.ilCtrl.php';
27  $ilCtrl_mock = $this->createMock('ilCtrl');
28  $ilCtrl_mock->expects($this->any())->method('saveParameter');
29  $ilCtrl_mock->expects($this->any())->method('saveParameterByClass');
30  global $ilCtrl;
31  $ilCtrl = $ilCtrl_mock;
32 
33  require_once './Services/Language/classes/class.ilLanguage.php';
34  $lng_mock = $this->createMock('ilLanguage', array('txt'), array(), '', false);
35  //$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
36  global $lng;
37  $lng = $lng_mock;
38 
39  $ilias_mock = new stdClass();
40  $ilias_mock->account = new stdClass();
41  $ilias_mock->account->id = 6;
42  $ilias_mock->account->fullname = 'Esther Tester';
43  global $ilias;
44  $ilias = $ilias_mock;
45  }
46  }
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ test_instantiateObject_shouldReturnInstance()

assSingleChoiceGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 48 of file assSingleChoiceGUITest.php.

49  {
50  // Arrange
51  require_once './Modules/TestQuestionPool/classes/class.assSingleChoiceGUI.php';
52 
53  // Act
54  $instance = new assSingleChoiceGUI();
55 
56  $this->assertInstanceOf('assSingleChoiceGUI', $instance);
57  }
Single choice question GUI representation.

Field Documentation

◆ $backupGlobals

assSingleChoiceGUITest::$backupGlobals = false
protected

Definition at line 15 of file assSingleChoiceGUITest.php.


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