ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
assSingleChoiceGUITest.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  {
21  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
22  ilUnitUtil::performInitialisation();
23  }
24  else
25  {
26  chdir( dirname( __FILE__ ) );
27  chdir('../../../');
28 
29  require_once './Services/UICore/classes/class.ilCtrl.php';
30  $ilCtrl_mock = $this->getMock('ilCtrl');
31  $ilCtrl_mock->expects( $this->any() )->method( 'saveParameter' );
32  $ilCtrl_mock->expects( $this->any() )->method( 'saveParameterByClass' );
33  global $ilCtrl;
34  $ilCtrl = $ilCtrl_mock;
35 
36  require_once './Services/Language/classes/class.ilLanguage.php';
37  $lng_mock = $this->getMock('ilLanguage', array('txt'), array(), '', false);
38  //$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
39  global $lng;
40  $lng = $lng_mock;
41 
42  $ilias_mock = new stdClass();
43  $ilias_mock->account = new stdClass();
44  $ilias_mock->account->id = 6;
45  $ilias_mock->account->fullname = 'Esther Tester';
46  global $ilias;
47  $ilias = $ilias_mock;
48  }
49  }
50 
52  {
53  // Arrange
54  require_once './Modules/TestQuestionPool/classes/class.assSingleChoiceGUI.php';
55 
56  // Act
57  $instance = new assSingleChoiceGUI();
58 
59  $this->assertInstanceOf('assSingleChoiceGUI', $instance);
60  }
61 }