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

Unit tests. More...

+ Inheritance diagram for assClozeTestGUITest:
+ Collaboration diagram for assClozeTestGUITest:

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 assClozeTestGUITest.php.

Member Function Documentation

◆ setUp()

assClozeTestGUITest::setUp ( )
protected

Definition at line 15 of file assClozeTestGUITest.php.

References $DIC, $GLOBALS, assBaseTestCase\getHttpMock(), and assBaseTestCase\setGlobalVariable().

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  require_once './Services/UICore/classes/class.ilCtrl.php';
25  $ilCtrl_mock = $this->createMock('ilCtrl');
26  $ilCtrl_mock->expects($this->any())->method('saveParameter');
27  $ilCtrl_mock->expects($this->any())->method('saveParameterByClass');
28  global $DIC;
29  unset($DIC['ilCtrl']);
30  $DIC['ilCtrl'] = $ilCtrl_mock;
31  $GLOBALS['ilCtrl'] = $DIC['ilCtrl'];
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 $DIC;
37  unset($DIC['lng']);
38  $DIC['lng'] = $lng_mock;
39  $GLOBALS['lng'] = $DIC['lng'];
40 
41  $ilias_mock = new stdClass();
42  $ilias_mock->account = new stdClass();
43  $ilias_mock->account->id = 6;
44  $ilias_mock->account->fullname = 'Esther Tester';
45  global $DIC;
46  unset($DIC['ilias']);
47  $DIC['ilias'] = $ilias_mock;
48  $GLOBALS['ilias'] = $DIC['ilias'];
49  $this->setGlobalVariable('http', $this->getHttpMock());
50  }
51  }
setGlobalVariable($name, $value)
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:

◆ test_instantiateObject_shouldReturnInstance()

assClozeTestGUITest::test_instantiateObject_shouldReturnInstance ( )

enabled

Definition at line 53 of file assClozeTestGUITest.php.

54  {
59  //$this->markTestIncomplete('Needs mock ilCtrl.');
60  // Arrange
61  require_once './Modules/TestQuestionPool/classes/class.assClozeTestGUI.php';
62 
63 
64 
65  // Act
66  $instance = new assClozeTestGUI();
67 
68  $this->assertInstanceOf('assClozeTestGUI', $instance);
69  }
Cloze test question GUI representation.

Field Documentation

◆ $backupGlobals

assClozeTestGUITest::$backupGlobals = false
protected

Definition at line 13 of file assClozeTestGUITest.php.


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