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_WorkflowWithSimpleIntermediateMessageEventShouldOutputAccordingly()
41 $this->markTestIncomplete(
42 '$ilDB throws notices during test.' 45 $test_name =
'IntermediateCatchEvent_Message_Simple';
53 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
56 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
58 require_once
'./Services/Database/classes/class.ilDB.php';
59 $ildb_mock = $this->getMock(
'ilDBMySQL',
array(
'nextId',
'quote',
'exec',
'insert'),
array(),
'',
false,
false);
60 $ildb_mock->expects( $this->any() )->method(
'quote')->will( $this->returnCallback(
''));
62 $ildb_mock->expects( $this->any() )->method(
'nextId' )->will( $this->returnValue($i++) );
63 $ildb_mock->expects( $this->any() )->method(
'exec' )->will( $this->returnValue(
true) );
64 $ildb_mock->expects( $this->any() )->method(
'insert' )->will( $this->returnValue(
true) );
77 $process =
new $test_name;
78 $process->startWorkflow();
79 $all_triggered =
true;
80 foreach($process->getNodes() as $node)
83 foreach($node->getDetectors() as $detector)
86 if(!$detector->getActivated())
88 $all_triggered =
false;
91 foreach($node->getEmitters() as $emitter)
94 if(!$emitter->getActivated())
96 $all_triggered =
false;
100 $this->assertFalse($all_triggered,
'All nodes were triggered (but should not since the event was not handled.');
102 $process->handleEvent(
113 $all_triggered =
true;
114 foreach($process->getNodes() as $node)
117 foreach($node->getDetectors() as $detector)
120 if(!$detector->getActivated())
122 $all_triggered =
false;
125 foreach($node->getEmitters() as $emitter)
128 if(!$emitter->getActivated())
130 $all_triggered =
false;
134 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
139 public function test_WorkflowWithSimpleIntermediateSignalEventShouldOutputAccordingly()
141 $this->markTestIncomplete(
142 '$ilDB throws notices during test.' 145 $test_name =
'IntermediateCatchEvent_Signal_Simple';
153 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
156 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
158 require_once
'./Services/Database/classes/class.ilDB.php';
159 $ildb_mock = $this->getMock(
'ilDBMySQL',
array(
'nextId',
'quote',
'exec',
'insert'),
array(),
'',
false,
false);
160 $ildb_mock->expects( $this->any() )->method(
'quote')->will( $this->returnCallback(
''));
162 $ildb_mock->expects( $this->any() )->method(
'nextId' )->will( $this->returnValue($i++) );
163 $ildb_mock->expects( $this->any() )->method(
'exec' )->will( $this->returnValue(
true) );
164 $ildb_mock->expects( $this->any() )->method(
'insert' )->will( $this->returnValue(
true) );
177 $process =
new $test_name;
178 $process->startWorkflow();
179 $all_triggered =
true;
180 foreach($process->getNodes() as $node)
183 foreach($node->getDetectors() as $detector)
186 if(!$detector->getActivated())
188 $all_triggered =
false;
191 foreach($node->getEmitters() as $emitter)
194 if(!$emitter->getActivated())
196 $all_triggered =
false;
200 $this->assertFalse($all_triggered,
'All nodes were triggered (but should not since the event was not handled.');
202 $process->handleEvent(
213 $all_triggered =
true;
214 foreach($process->getNodes() as $node)
217 foreach($node->getDetectors() as $detector)
220 if(!$detector->getActivated())
222 $all_triggered =
false;
225 foreach($node->getEmitters() as $emitter)
228 if(!$emitter->getActivated())
230 $all_triggered =
false;
234 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
239 public function test_WorkflowWithSimpleIntermediateTimerEventShouldOutputAccordingly()
241 $this->markTestIncomplete(
242 '$ilDB throws notices during test.' 244 $test_name =
'IntermediateCatchEvent_Timer_Simple';
252 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
255 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
257 require_once
'./Services/Database/classes/class.ilDB.php';
258 $ildb_mock = $this->getMock(
'ilDBMySQL',
array(
'nextId',
'quote',
'exec',
'insert'),
array(),
'',
false,
false);
259 $ildb_mock->expects( $this->any() )->method(
'quote')->will( $this->returnCallback(
''));
261 $ildb_mock->expects( $this->any() )->method(
'nextId' )->will( $this->returnValue($i++) );
262 $ildb_mock->expects( $this->any() )->method(
'exec' )->will( $this->returnValue(
true) );
263 $ildb_mock->expects( $this->any() )->method(
'insert' )->will( $this->returnValue(
true) );
276 $process =
new $test_name;
277 $process->startWorkflow();
278 $all_triggered =
true;
279 foreach($process->getNodes() as $node)
282 foreach($node->getDetectors() as $detector)
285 if(!$detector->getActivated())
287 $all_triggered =
false;
290 foreach($node->getEmitters() as $emitter)
293 if(!$emitter->getActivated())
295 $all_triggered =
false;
299 $this->assertFalse($all_triggered,
'All nodes were triggered (but should not since the event was not handled.');
301 $process->handleEvent(
312 $all_triggered =
true;
313 foreach($process->getNodes() as $node)
316 foreach($node->getDetectors() as $detector)
319 if(!$detector->getActivated())
321 $all_triggered =
false;
324 foreach($node->getEmitters() as $emitter)
327 if(!$emitter->getActivated())
329 $all_triggered =
false;
333 $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.