ILIAS  release_7 Revision v7.30-3-g800a261c036
assErrorTextGUITest Class Reference

Unit tests. More...

+ Inheritance diagram for assErrorTextGUITest:
+ Collaboration diagram for assErrorTextGUITest:

Public Member Functions

 test_instantiateObject_shouldReturnInstance ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from assBaseTestCase
 setUp ()
 
 setGlobalVariable ($name, $value)
 
 getGlobalTemplateMock ()
 
 getHttpMock ()
 
 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 assErrorTextGUITest.php.

Member Function Documentation

◆ setUp()

assErrorTextGUITest::setUp ( )
protected

Reimplemented from assBaseTestCase.

Definition at line 15 of file assErrorTextGUITest.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
25 parent::setUp();
26
27 require_once './Services/UICore/classes/class.ilCtrl.php';
28 $ilCtrl_mock = $this->createMock('ilCtrl');
29 $ilCtrl_mock->expects($this->any())->method('saveParameter');
30 $ilCtrl_mock->expects($this->any())->method('saveParameterByClass');
31 $this->setGlobalVariable('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 $this->setGlobalVariable('lng', $lng_mock);
37
38 $this->setGlobalVariable('ilias', $this->getIliasMock());
39 $this->setGlobalVariable('tpl', $this->getGlobalTemplateMock());
40 $this->setGlobalVariable('ilDB', $this->getDatabaseMock());
41 $this->setGlobalVariable('http', $this->getHttpMock());
42 }
setGlobalVariable($name, $value)

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

+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

assErrorTextGUITest::test_instantiateObject_shouldReturnInstance ( )

Definition at line 44 of file assErrorTextGUITest.php.

45 {
46 //$this->markTestIncomplete('Needs mock.');
47 // Arrange
48 require_once './Modules/TestQuestionPool/classes/class.assErrorTextGUI.php';
49 $this->getGlobalTemplateMock()->expects($this->any())->method('addOnloadCode');
50
51 // Act
52 $instance = new assErrorTextGUI();
53
54 $this->assertInstanceOf('assErrorTextGUI', $instance);
55 }
The assErrorTextGUI class encapsulates the GUI representation for error text questions.

References assBaseTestCase\getGlobalTemplateMock().

+ Here is the call graph for this function:

Field Documentation

◆ $backupGlobals

assErrorTextGUITest::$backupGlobals = false
protected

Definition at line 13 of file assErrorTextGUITest.php.


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