ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
assTextQuestionTest Class Reference

Unit tests. More...

+ Inheritance diagram for assTextQuestionTest:
+ Collaboration diagram for assTextQuestionTest:

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.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 11 of file assTextQuestionTest.php.

Member Function Documentation

◆ setUp()

assTextQuestionTest::setUp ( )
protected

Reimplemented from assBaseTestCase.

Definition at line 15 of file assTextQuestionTest.php.

15 : void
16 {
17 if (defined('ILIAS_PHPUNIT_CONTEXT')) {
18 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
19 ilUnitUtil::performInitialisation();
20 } else {
21 chdir(dirname(__FILE__));
22 chdir('../../../');
23
24 parent::setUp();
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 $this->setGlobalVariable('ilCtrl', $ilCtrl_mock);
31
32 require_once './Services/Language/classes/class.ilLanguage.php';
33 $lng_mock = $this->createMock('ilLanguage', array('txt'), array(), '', false);
34 //$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
35 $this->setGlobalVariable('lng', $lng_mock);
36
37 $this->setGlobalVariable('ilias', $this->getIliasMock());
38 $this->setGlobalVariable('tpl', $this->getGlobalTemplateMock());
39 $this->setGlobalVariable('ilDB', $this->getDatabaseMock());
40 }
41 }
setGlobalVariable($name, $value)

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

+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

assTextQuestionTest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 43 of file assTextQuestionTest.php.

44 {
45 // Arrange
46 require_once './Modules/TestQuestionPool/classes/class.assTextQuestion.php';
47
48 // Act
49 $instance = new assTextQuestion();
50
51 $this->assertInstanceOf('assTextQuestion', $instance);
52 }
Class for text questions.

Field Documentation

◆ $backupGlobals

assTextQuestionTest::$backupGlobals = false
protected

Definition at line 13 of file assTextQuestionTest.php.


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