ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

18 {
19 if (defined('ILIAS_PHPUNIT_CONTEXT'))
20 {
21 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
22 ilUnitUtil::performInitialisation();
23 }
24 else
25 {
26 chdir( dirname( __FILE__ ) );
27 chdir('../../../');
28
29 require_once './Services/UICore/classes/class.ilCtrl.php';
30 $ilCtrl_mock = $this->getMock('ilCtrl');
31 $ilCtrl_mock->expects( $this->any() )->method( 'saveParameter' );
32 $ilCtrl_mock->expects( $this->any() )->method( 'saveParameterByClass' );
33 global $ilCtrl;
34 $ilCtrl = $ilCtrl_mock;
35
36 require_once './Services/Language/classes/class.ilLanguage.php';
37 $lng_mock = $this->getMock('ilLanguage', array('txt'), array(), '', false);
38 //$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
39 global $lng;
40 $lng = $lng_mock;
41
42 $ilias_mock = new stdClass();
43 $ilias_mock->account = new stdClass();
44 $ilias_mock->account->id = 6;
45 $ilias_mock->account->fullname = 'Esther Tester';
46 global $ilias;
47 $ilias = $ilias_mock;
48 }
49 }
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40

References $ilCtrl, and $lng.

◆ test_instantiateObject_shouldReturnInstance()

assSingleChoiceGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 51 of file assSingleChoiceGUITest.php.

52 {
53 // Arrange
54 require_once './Modules/TestQuestionPool/classes/class.assSingleChoiceGUI.php';
55
56 // Act
57 $instance = new assSingleChoiceGUI();
58
59 $this->assertInstanceOf('assSingleChoiceGUI', $instance);
60 }
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: