15 public $base_path =
'./Services/WorkflowEngine/test/parser/';
20 return $this->base_path . $this->suite_path . $test_name .
'.bpmn2';
25 return $this->base_path . $this->suite_path . $test_name .
'_output.php';
30 return $this->base_path . $this->suite_path . $test_name .
'_goldsample.php';
35 chdir( dirname( __FILE__ ) );
36 chdir(
'../../../../../' );
38 require_once
'./Services/WorkflowEngine/classes/parser/class.ilBPMN2Parser.php';
41 public function test_WorkflowWithExclusiveGatewayForkingShouldOutputAccordingly()
43 $test_name =
'ExclusiveGateway_Fork_Simple';
51 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
54 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
57 $process =
new $test_name;
58 $this->assertFalse($process->isActive(),
'Process is not active.');
60 $process->startWorkflow();
61 $all_triggered =
true;
62 foreach($process->getNodes() as $node)
65 foreach($node->getDetectors() as $detector)
68 if(!$detector->getActivated())
70 $all_triggered =
false;
73 foreach($node->getEmitters() as $emitter)
76 if(!$emitter->getActivated())
78 $all_triggered =
false;
82 $this->assertFalse($all_triggered,
'All nodes were triggered.');
85 foreach($process->getNodes() as $node)
89 $all_inactive =
false;
92 $this->assertFalse($all_inactive,
'Not all nodes are inactive.');
99 public function test_WorkflowWithExclusiveGatewayJoiningShouldOutputAccordingly()
101 $test_name =
'ExclusiveGateway_Join_Simple';
109 $this->assertTrue(substr($return,0,25) ==
'No syntax errors detected',
'Lint of output code failed.');
112 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
115 $process =
new $test_name;
116 $this->assertFalse($process->isActive(),
'Process is inactive.');
118 $process->startWorkflow();
119 $all_triggered =
true;
120 foreach($process->getNodes() as $node)
123 foreach($node->getDetectors() as $detector)
126 if(!$detector->getActivated())
128 $all_triggered =
false;
131 foreach($node->getEmitters() as $emitter)
134 if(!$emitter->getActivated())
136 $all_triggered =
false;
140 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
142 $all_inactive =
true;
143 foreach($process->getNodes() as $node)
145 if($node->isActive())
147 $all_inactive =
false;
150 $this->assertTrue($all_inactive,
'Not all nodes are inactive.');
getTestGoldsampleFilename($test_name)
getTestOutputFilename($test_name)
getTestInputFilename($test_name)