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_WorkflowWithSimpleParallelGatewayShouldOutputAccordingly()
41 $test_name =
'ParallelGateway_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.');
56 $process =
new $test_name;
57 $this->assertFalse($process->isActive());
67 $process->startWorkflow();
68 $this->assertTrue($process->isActive());
70 $all_triggered =
true;
71 foreach($process->getNodes() as $node)
74 foreach($node->getDetectors() as $detector)
77 if(!$detector->getActivated())
79 $all_triggered =
false;
82 foreach($node->getEmitters() as $emitter)
85 if(!$emitter->getActivated())
87 $all_triggered =
false;
91 $this->assertTrue($all_triggered,
'Not all nodes were triggered immediately on activation.');
95 public function test_WorkflowWithJoiningParallelGatewayShouldOutputAccordingly()
97 $test_name =
'ParallelGateway_Joining';
105 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
108 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
111 $process =
new $test_name;
112 $this->assertFalse($process->isActive());
114 $process->startWorkflow();
115 $all_triggered =
true;
116 foreach($process->getNodes() as $node)
119 foreach($node->getDetectors() as $detector)
122 if(!$detector->getActivated())
124 $all_triggered =
false;
127 foreach($node->getEmitters() as $emitter)
130 if(!$emitter->getActivated())
132 $all_triggered =
false;
136 $this->assertTrue($all_triggered);
140 public function test_WorkflowWithForkingParallelGatewayShouldOutputAccordingly()
142 $test_name =
'ParallelGateway_Forking';
150 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
153 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
156 $process =
new $test_name;
157 $this->assertFalse($process->isActive());
159 $process->startWorkflow();
160 $all_triggered =
true;
161 foreach($process->getNodes() as $node)
164 foreach($node->getDetectors() as $detector)
167 if(!$detector->getActivated())
169 $all_triggered =
false;
172 foreach($node->getEmitters() as $emitter)
175 if(!$emitter->getActivated())
177 $all_triggered =
false;
181 $this->assertTrue($all_triggered);
getTestGoldsampleFilename($test_name)
getTestOutputFilename($test_name)
getTestInputFilename($test_name)