ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestFinalMarkLangVarBuilderTest.php
Go to the documentation of this file.
1 <?php
2 
20 
28 class ilTestFinalMarkLangVarBuilderTest extends TestCase
29 {
30  protected $backupGlobals = false;
31 
32  protected function setUp(): void
33  {
34  chdir(dirname(__FILE__));
35  chdir('../../../');
36  }
37 
41  public function test_build()
42  {
43  $testCases = array(
44  array(
45  'param_passedStatus' => false,
46  'param_obligationsAnsweredStatus' => false,
47  'param_obligationsEnabled' => false,
48  'expected' => 'mark_tst_failed'
49  ),
50  array(
51  'param_passedStatus' => false,
52  'param_obligationsAnsweredStatus' => false,
53  'param_obligationsEnabled' => true,
54  'expected' => 'mark_tst_failed_obligations_missing'
55  ),
56  array(
57  'param_passedStatus' => false,
58  'param_obligationsAnsweredStatus' => true,
59  'param_obligationsEnabled' => false,
60  'expected' => 'mark_tst_failed'
61  ),
62  array(
63  'param_passedStatus' => false,
64  'param_obligationsAnsweredStatus' => true,
65  'param_obligationsEnabled' => true,
66  'expected' => 'mark_tst_failed_obligations_answered'
67  ),
68  array(
69  'param_passedStatus' => true,
70  'param_obligationsAnsweredStatus' => false,
71  'param_obligationsEnabled' => false,
72  'expected' => 'mark_tst_passed'
73  ),
74  array(
75  'param_passedStatus' => true,
76  'param_obligationsAnsweredStatus' => false,
77  'param_obligationsEnabled' => true,
78  'expected' => 'mark_tst_failed_obligations_missing'
79  ),
80  array(
81  'param_passedStatus' => true,
82  'param_obligationsAnsweredStatus' => true,
83  'param_obligationsEnabled' => false,
84  'expected' => 'mark_tst_passed'
85  ),
86  array(
87  'param_passedStatus' => true,
88  'param_obligationsAnsweredStatus' => true,
89  'param_obligationsEnabled' => true,
90  'expected' => 'mark_tst_passed_obligations_answered'
91  )
92  );
93  // OTX: Test breaks with fatal error...
94 // foreach($testCases as $case)
95 // {
96 // // arrange
97 //
98 // $passedStatus = $case['param_passedStatus'];
99 // $obligationsAnsweredStatus = $case['param_obligationsAnsweredStatus'];
100 // $obligationsEnabled = $case['param_obligationsEnabled'];
101 //
102 // $expected = $case['expected'];
103 //
104 // require_once './Modules/Test/classes/class.ilTestFinalMarkLangVarBuilder.php';
105 // $instance = new ilTestFinalMarkLangVarBuilder($passedStatus, $obligationsAnsweredStatus, $obligationsEnabled);
106 //
107 // // act
108 //
109 // $actual = $instance->build();
110 //
111 // // assert
112 //
113 // $this->assertEquals($expected, $actual);
114 // }
115  }
116 }