ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
assTextQuestionGUITest.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11
class
assTextQuestionGUITest
extends
assBaseTestCase
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
parent::setUp();
25
26
require_once
'./Services/UICore/classes/class.ilCtrl.php'
;
27
$ilCtrl_mock = $this->createMock(
'ilCtrl'
);
28
$ilCtrl_mock->expects($this->any())->method(
'saveParameter'
);
29
$ilCtrl_mock->expects($this->any())->method(
'saveParameterByClass'
);
30
$this->
setGlobalVariable
(
'ilCtrl'
, $ilCtrl_mock);
31
32
require_once
'./Services/Language/classes/class.ilLanguage.php'
;
33
$lng_mock = $this->createMock(
'ilLanguage'
, array(
'txt'
), array(),
''
,
false
);
34
//$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
35
$this->
setGlobalVariable
(
'lng'
, $lng_mock);
36
37
$this->
setGlobalVariable
(
'ilias'
, $this->
getIliasMock
());
38
$this->
setGlobalVariable
(
'tpl'
, $this->
getGlobalTemplateMock
());
39
$this->
setGlobalVariable
(
'ilDB'
, $this->
getDatabaseMock
());
40
}
41
}
42
43
public
function
test_instantiateObject_shouldReturnInstance
()
44
{
45
// Arrange
46
require_once
'./Modules/TestQuestionPool/classes/class.assTextQuestionGUI.php'
;
47
48
// Act
49
$instance =
new
assTextQuestionGUI
();
50
51
$this->assertInstanceOf(
'assTextQuestionGUI'
, $instance);
52
}
53
}
assTextQuestionGUITest\test_instantiateObject_shouldReturnInstance
test_instantiateObject_shouldReturnInstance()
Definition:
assTextQuestionGUITest.php:43
assBaseTestCase
Class assBaseTestCase.
Definition:
assBaseTestCase.php:7
assTextQuestionGUI
Text question GUI representation.
Definition:
class.assTextQuestionGUI.php:23
assBaseTestCase\getGlobalTemplateMock
getGlobalTemplateMock()
Definition:
assBaseTestCase.php:36
assBaseTestCase\setGlobalVariable
setGlobalVariable($name, $value)
Definition:
assBaseTestCase.php:23
php
assTextQuestionGUITest\$backupGlobals
$backupGlobals
Definition:
assTextQuestionGUITest.php:13
assTextQuestionGUITest
Unit tests.
Definition:
assTextQuestionGUITest.php:11
assBaseTestCase\getIliasMock
getIliasMock()
Definition:
assBaseTestCase.php:52
assBaseTestCase\getDatabaseMock
getDatabaseMock()
Definition:
assBaseTestCase.php:44
assTextQuestionGUITest\setUp
setUp()
Definition:
assTextQuestionGUITest.php:15
Modules
TestQuestionPool
test
assTextQuestionGUITest.php
Generated on Thu Jan 16 2025 19:02:14 for ILIAS by
1.8.13 (using
Doxyfile
)