ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
assMultipleChoiceGUITest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
14{
15 protected $backupGlobals = false;
16
17 protected function setUp() : void
18 {
19 if (defined('ILIAS_PHPUNIT_CONTEXT')) {
20 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
21 ilUnitUtil::performInitialisation();
22 } else {
23 chdir(dirname(__FILE__));
24 chdir('../../../');
25
26 parent::setUp();
27
28 require_once './Services/UICore/classes/class.ilCtrl.php';
29 $ilCtrl_mock = $this->createMock('ilCtrl');
30 $ilCtrl_mock->expects($this->any())->method('saveParameter');
31 $ilCtrl_mock->expects($this->any())->method('saveParameterByClass');
32 $this->setGlobalVariable('ilCtrl', $ilCtrl_mock);
33
34 require_once './Services/Language/classes/class.ilLanguage.php';
35 $lng_mock = $this->createMock('ilLanguage', array('txt'), array(), '', false);
36 //$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
37 $this->setGlobalVariable('lng', $lng_mock);
38
39 $this->setGlobalVariable('ilias', $this->getIliasMock());
40 $this->setGlobalVariable('tpl', $this->getGlobalTemplateMock());
41 $this->setGlobalVariable('ilDB', $this->getDatabaseMock());
42 }
43 }
44
46 {
47 // Arrange
48 require_once './Modules/TestQuestionPool/classes/class.assMultipleChoiceGUI.php';
49
50 // Act
51 $instance = new assMultipleChoiceGUI();
52
53 $this->assertInstanceOf('assMultipleChoiceGUI', $instance);
54 }
55}
An exception for terminatinating execution or to throw for unit testing.
Class assBaseTestCase.
setGlobalVariable($name, $value)
Unit tests for single choice questions.
Multiple choice question GUI representation.