ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestFinalMarkLangVarBuilderTest.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
15 {
16  protected $backupGlobals = false;
17 
18  protected function setUp()
19  {
20  if (defined('ILIAS_PHPUNIT_CONTEXT')) {
21  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
22  ilUnitUtil::performInitialisation();
23  } else {
24  chdir(dirname(__FILE__));
25  chdir('../../../');
26  }
27  }
28 
29  public function test_build()
30  {
31  $testCases = array(
32  array(
33  'param_passedStatus' => false, 'param_obligationsAnsweredStatus' => false, 'param_obligationsEnabled' => false,
34  'expected' => 'mark_tst_failed'
35  ),
36  array(
37  'param_passedStatus' => false, 'param_obligationsAnsweredStatus' => false, 'param_obligationsEnabled' => true,
38  'expected' => 'mark_tst_failed_obligations_missing'
39  ),
40  array(
41  'param_passedStatus' => false, 'param_obligationsAnsweredStatus' => true, 'param_obligationsEnabled' => false,
42  'expected' => 'mark_tst_failed'
43  ),
44  array(
45  'param_passedStatus' => false,
46  'param_obligationsAnsweredStatus' => true,
47  'param_obligationsEnabled' => true,
48  'expected' => 'mark_tst_failed_obligations_answered'
49  ),
50  array(
51  'param_passedStatus' => true,
52  'param_obligationsAnsweredStatus' => false,
53  'param_obligationsEnabled' => false,
54  'expected' => 'mark_tst_passed'
55  ),
56  array(
57  'param_passedStatus' => true,
58  'param_obligationsAnsweredStatus' => false,
59  'param_obligationsEnabled' => true,
60  'expected' => 'mark_tst_failed_obligations_missing'
61  ),
62  array(
63  'param_passedStatus' => true,
64  'param_obligationsAnsweredStatus' => true,
65  'param_obligationsEnabled' => false,
66  'expected' => 'mark_tst_passed'
67  ),
68  array(
69  'param_passedStatus' => true,
70  'param_obligationsAnsweredStatus' => true,
71  'param_obligationsEnabled' => true,
72  'expected' => 'mark_tst_passed_obligations_answered'
73  )
74  );
75  // OTX: Test breaks with fatal error...
76 // foreach($testCases as $case)
77 // {
78 // // arrange
79 //
80 // $passedStatus = $case['param_passedStatus'];
81 // $obligationsAnsweredStatus = $case['param_obligationsAnsweredStatus'];
82 // $obligationsEnabled = $case['param_obligationsEnabled'];
83 //
84 // $expected = $case['expected'];
85 //
86 // require_once './Modules/Test/classes/class.ilTestFinalMarkLangVarBuilder.php';
87 // $instance = new ilTestFinalMarkLangVarBuilder($passedStatus, $obligationsAnsweredStatus, $obligationsEnabled);
88 //
89 // // act
90 //
91 // $actual = $instance->build();
92 //
93 // // assert
94 //
95 // $this->assertEquals($expected, $actual);
96 // }
97  }
98 }