ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
assClozeTestGUITest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12{
13 protected $backupGlobals = false;
14
15 protected function setUp()
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 }
50 }
51
53 {
58 //$this->markTestIncomplete('Needs mock ilCtrl.');
59 // Arrange
60 require_once './Modules/TestQuestionPool/classes/class.assClozeTestGUI.php';
61
62
63
64 // Act
65 $instance = new assClozeTestGUI();
66
67 $this->assertInstanceOf('assClozeTestGUI', $instance);
68 }
69}
An exception for terminatinating execution or to throw for unit testing.
Cloze test question GUI representation.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
global $DIC
Definition: saml.php:7