13 public $base_path =
'./Services/WorkflowEngine/test/parser/';
18 return $this->base_path . $this->suite_path . $test_name .
'.bpmn2';
23 return $this->base_path . $this->suite_path . $test_name .
'_output.php';
28 return $this->base_path . $this->suite_path . $test_name .
'_goldsample.php';
33 chdir( dirname( __FILE__ ) );
34 chdir(
'../../../../../' );
36 require_once
'./Services/WorkflowEngine/classes/parser/class.ilBPMN2Parser.php';
39 public function test_WorkflowWithSimpleEndEventShouldOutputAccordingly()
41 $test_name =
'EndEvent_Blanko_Simple';
49 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
52 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
55 $process =
new $test_name;
56 $process->startWorkflow();
57 $all_triggered =
true;
58 foreach($process->getNodes() as $node)
61 foreach($node->getDetectors() as $detector)
64 if(!$detector->getActivated())
66 $all_triggered =
false;
69 foreach($node->getEmitters() as $emitter)
72 if(!$emitter->getActivated())
74 $all_triggered =
false;
78 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
83 public function test_WorkflowWithSignalEndEventShouldOutputAccordingly()
85 $test_name =
'EndEvent_Signal_Simple';
93 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
96 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
98 $ilappeventhandler_mock = $this->getMock(
'ilAppEventHandler',
array(
'raise'),
array(),
'',
false,
false);
99 $ilappeventhandler_mock
100 ->expects( $this->once() )
102 ->will( $this->returnValue(
true) );
105 global $ilAppEventHandler;
106 $ilAppEventHandler = $ilappeventhandler_mock;
107 $GLOBALS[
'ilAppEventHandler'] = $ilappeventhandler_mock;
110 $process =
new $test_name;
111 $process->startWorkflow();
112 $all_triggered =
true;
113 foreach($process->getNodes() as $node)
116 foreach($node->getDetectors() as $detector)
119 if(!$detector->getActivated())
121 $all_triggered =
false;
124 foreach($node->getEmitters() as $emitter)
127 if(!$emitter->getActivated())
129 $all_triggered =
false;
133 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
138 public function test_WorkflowWithMessageEndEventShouldOutputAccordingly()
140 $test_name =
'EndEvent_Message_Simple';
148 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
151 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
153 $ilappeventhandler_mock = $this->getMock(
'ilAppEventHandler',
array(
'raise'),
array(),
'',
false,
false);
154 $ilappeventhandler_mock
155 ->expects( $this->once() )
157 ->will( $this->returnValue(
true) );
160 global $ilAppEventHandler;
161 $ilAppEventHandler = $ilappeventhandler_mock;
162 $GLOBALS[
'ilAppEventHandler'] = $ilappeventhandler_mock;
165 $process =
new $test_name;
166 $process->startWorkflow();
167 $all_triggered =
true;
168 foreach($process->getNodes() as $node)
171 foreach($node->getDetectors() as $detector)
174 if(!$detector->getActivated())
176 $all_triggered =
false;
179 foreach($node->getEmitters() as $emitter)
182 if(!$emitter->getActivated())
184 $all_triggered =
false;
188 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
193 public function test_WorkflowWithTerminateEndEventShouldOutputAccordingly()
195 $test_name =
'EndEvent_Terminate_Simple';
203 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
206 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
209 $process =
new $test_name;
210 $process->startWorkflow();
211 $all_triggered =
true;
212 foreach($process->getNodes() as $node)
215 foreach($node->getDetectors() as $detector)
218 if(!$detector->getActivated())
220 $all_triggered =
false;
223 foreach($node->getEmitters() as $emitter)
226 if(!$emitter->getActivated())
228 $all_triggered =
false;
232 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
getTestInputFilename($test_name)
getTestOutputFilename($test_name)
getTestGoldsampleFilename($test_name)