ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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  $this->setGlobalVariable('http', $this->getHttpMock());
43  }
44  }
45 
47  {
48  // Arrange
49  require_once './Modules/TestQuestionPool/classes/class.assMultipleChoiceGUI.php';
50 
51  // Act
52  $instance = new assMultipleChoiceGUI();
53 
54  $this->assertInstanceOf('assMultipleChoiceGUI', $instance);
55  }
56 }
Class assBaseTestCase.
setGlobalVariable($name, $value)
Multiple choice question GUI representation.
Unit tests for single choice questions.