ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
assTextQuestionTest.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
assTextQuestionTest
extends
PHPUnit_Framework_TestCase
12
{
13
protected
$backupGlobals
= FALSE;
14
15
protected
function
setUp
()
16
{
17
if
(
defined
(
'ILIAS_PHPUNIT_CONTEXT'
))
18
{
19
include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php"
);
20
ilUnitUtil::performInitialisation();
21
}
22
else
23
{
24
chdir( dirname( __FILE__ ) );
25
chdir(
'../../../'
);
26
27
require_once
'./Services/UICore/classes/class.ilCtrl.php'
;
28
$ilCtrl_mock = $this->getMock(
'ilCtrl'
);
29
$ilCtrl_mock->expects( $this->any() )->method(
'saveParameter'
);
30
$ilCtrl_mock->expects( $this->any() )->method(
'saveParameterByClass'
);
31
global
$ilCtrl
;
32
$ilCtrl = $ilCtrl_mock;
33
34
require_once
'./Services/Language/classes/class.ilLanguage.php'
;
35
$lng_mock = $this->getMock(
'ilLanguage'
,
array
(
'txt'
),
array
(),
''
,
false
);
36
//$lng_mock->expects( $this->once() )->method( 'txt' )->will( $this->returnValue('Test') );
37
global
$lng
;
38
$lng = $lng_mock;
39
40
$ilias_mock =
new
stdClass();
41
$ilias_mock->account =
new
stdClass();
42
$ilias_mock->account->id = 6;
43
$ilias_mock->account->fullname =
'Esther Tester'
;
44
global $ilias;
45
$ilias = $ilias_mock;
46
}
47
}
48
49
public
function
test_instantiateObject_shouldReturnInstance
()
50
{
51
// Arrange
52
require_once
'./Modules/TestQuestionPool/classes/class.assTextQuestion.php'
;
53
54
// Act
55
$instance =
new
assTextQuestion
();
56
57
$this->assertInstanceOf(
'assTextQuestion'
, $instance);
58
}
59
}
assTextQuestionTest\test_instantiateObject_shouldReturnInstance
test_instantiateObject_shouldReturnInstance()
Definition:
assTextQuestionTest.php:49
PHPUnit_Framework_TestCase
$ilCtrl
global $ilCtrl
Definition:
ilias.php:18
assTextQuestion
Class for text questions.
Definition:
class.assTextQuestion.php:22
assTextQuestionTest\setUp
setUp()
Definition:
assTextQuestionTest.php:15
assTextQuestionTest\$backupGlobals
$backupGlobals
Definition:
assTextQuestionTest.php:13
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
$lng
global $lng
Definition:
privfeed.php:17
assTextQuestionTest
Unit tests.
Definition:
assTextQuestionTest.php:11
php
defined
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition:
bootstrap.php:27
Modules
TestQuestionPool
test
assTextQuestionTest.php
Generated on Fri Jan 17 2025 19:01:06 for ILIAS by
1.8.13 (using
Doxyfile
)