ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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

assSingleChoiceGUITest::setUp ( )
protected

Definition at line 17 of file assSingleChoiceGUITest.php.

References $ilCtrl, and $lng.

{
if (defined('ILIAS_PHPUNIT_CONTEXT'))
{
include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
ilUnitUtil::performInitialisation();
}
else
{
chdir( dirname( __FILE__ ) );
chdir('../../../');
require_once './Services/UICore/classes/class.ilCtrl.php';
$ilCtrl_mock = $this->getMock('ilCtrl');
$ilCtrl_mock->expects( $this->any() )->method( 'saveParameter' );
$ilCtrl_mock->expects( $this->any() )->method( 'saveParameterByClass' );
global $ilCtrl;
$ilCtrl = $ilCtrl_mock;
require_once './Services/Language/classes/class.ilLanguage.php';
$lng_mock = $this->getMock('ilLanguage', array('txt'), array(), '', false);
//$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
global $lng;
$lng = $lng_mock;
$ilias_mock = new stdClass();
$ilias_mock->account = new stdClass();
$ilias_mock->account->id = 6;
$ilias_mock->account->fullname = 'Esther Tester';
global $ilias;
$ilias = $ilias_mock;
}
}
assSingleChoiceGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 51 of file assSingleChoiceGUITest.php.

{
// Arrange
require_once './Modules/TestQuestionPool/classes/class.assSingleChoiceGUI.php';
// Act
$instance = new assSingleChoiceGUI();
$this->assertInstanceOf('assSingleChoiceGUI', $instance);
}

Field Documentation

assSingleChoiceGUITest::$backupGlobals = FALSE
protected

Definition at line 15 of file assSingleChoiceGUITest.php.


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