ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
PHPUnit_Framework_TestCase
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
require_once
'./Services/UICore/classes/class.ilCtrl.php'
;
25
$ilCtrl_mock = $this->createMock(
'ilCtrl'
);
26
$ilCtrl_mock->expects($this->any())->method(
'saveParameter'
);
27
$ilCtrl_mock->expects($this->any())->method(
'saveParameterByClass'
);
28
global
$ilCtrl
;
29
$ilCtrl = $ilCtrl_mock;
30
31
require_once
'./Services/Language/classes/class.ilLanguage.php'
;
32
$lng_mock = $this->createMock(
'ilLanguage'
,
array
(
'txt'
),
array
(),
''
,
false
);
33
//$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
34
global
$lng
;
35
$lng = $lng_mock;
36
37
$ilias_mock =
new
stdClass();
38
$ilias_mock->account =
new
stdClass();
39
$ilias_mock->account->id = 6;
40
$ilias_mock->account->fullname =
'Esther Tester'
;
41
global $ilias;
42
$ilias = $ilias_mock;
43
}
44
}
45
46
public
function
test_instantiateObject_shouldReturnInstance
()
47
{
48
// Arrange
49
require_once
'./Modules/TestQuestionPool/classes/class.assTextQuestionGUI.php'
;
50
51
// Act
52
$instance =
new
assTextQuestionGUI
();
53
54
$this->assertInstanceOf(
'assTextQuestionGUI'
, $instance);
55
}
56
}
assTextQuestionGUITest\test_instantiateObject_shouldReturnInstance
test_instantiateObject_shouldReturnInstance()
Definition:
assTextQuestionGUITest.php:46
PHPUnit_Framework_TestCase
assTextQuestionGUI
Text question GUI representation.
Definition:
class.assTextQuestionGUI.php:23
$ilCtrl
global $ilCtrl
Definition:
ilias.php:18
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
$lng
global $lng
Definition:
privfeed.php:17
defined
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition:
bootstrap.php:27
assTextQuestionGUITest\$backupGlobals
$backupGlobals
Definition:
assTextQuestionGUITest.php:13
assTextQuestionGUITest
Unit tests.
Definition:
assTextQuestionGUITest.php:11
assTextQuestionGUITest\setUp
setUp()
Definition:
assTextQuestionGUITest.php:15
Modules
TestQuestionPool
test
assTextQuestionGUITest.php
Generated on Sat Jan 18 2025 19:01:24 for ILIAS by
1.8.13 (using
Doxyfile
)