20 if (defined(
'ILIAS_PHPUNIT_CONTEXT'))
22 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
23 ilUnitUtil::performInitialisation();
27 chdir( dirname( __FILE__ ) );
36 'param_passedStatus' =>
false,
'param_obligationsAnsweredStatus' =>
false,
'param_obligationsEnabled' =>
false,
37 'expected' =>
'mark_tst_failed'
40 'param_passedStatus' =>
false,
'param_obligationsAnsweredStatus' =>
false,
'param_obligationsEnabled' =>
true,
41 'expected' =>
'mark_tst_failed_obligations_missing'
44 'param_passedStatus' =>
false,
'param_obligationsAnsweredStatus' =>
true,
'param_obligationsEnabled' =>
false,
45 'expected' =>
'mark_tst_failed'
48 'param_passedStatus' =>
false,
49 'param_obligationsAnsweredStatus' =>
true,
50 'param_obligationsEnabled' =>
true,
51 'expected' =>
'mark_tst_failed_obligations_answered'
54 'param_passedStatus' =>
true,
55 'param_obligationsAnsweredStatus' =>
false,
56 'param_obligationsEnabled' =>
false,
57 'expected' =>
'mark_tst_passed'
60 'param_passedStatus' =>
true,
61 'param_obligationsAnsweredStatus' =>
false,
62 'param_obligationsEnabled' =>
true,
63 'expected' =>
'mark_tst_failed_obligations_missing'
66 'param_passedStatus' =>
true,
67 'param_obligationsAnsweredStatus' =>
true,
68 'param_obligationsEnabled' =>
false,
69 'expected' =>
'mark_tst_passed'
72 'param_passedStatus' =>
true,
73 'param_obligationsAnsweredStatus' =>
true,
74 'param_obligationsEnabled' =>
true,
75 'expected' =>
'mark_tst_passed_obligations_answered'
79 foreach($testCases as $case)
83 $passedStatus = $case[
'param_passedStatus'];
84 $obligationsAnsweredStatus = $case[
'param_obligationsAnsweredStatus'];
85 $obligationsEnabled = $case[
'param_obligationsEnabled'];
87 $expected = $case[
'expected'];
89 require_once
'./Modules/Test/classes/class.ilTestFinalMarkLangVarBuilder.php';
90 $instance =
new ilTestFinalMarkLangVarBuilder($passedStatus, $obligationsAnsweredStatus, $obligationsEnabled);
94 $actual = $instance->build();
98 $this->assertEquals($expected, $actual);