ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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()
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 }
Class assBaseTestCase.
setGlobalVariable($name, $value)
Multiple choice question GUI representation.
Unit tests for single choice questions.