4 require_once
'Services/WorkflowEngine/test/ilWorkflowEngineBaseTest.php';
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(
'../../../../../');
40 require_once
'./Services/WorkflowEngine/classes/parser/class.ilBPMN2Parser.php';
43 public function test_WorkflowWithSimpleParallelGatewayShouldOutputAccordingly()
45 $test_name =
'ParallelGateway_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.');
60 $process =
new $test_name;
61 $this->assertFalse($process->isActive());
71 $process->startWorkflow();
72 $this->assertTrue($process->isActive());
74 $all_triggered =
true;
75 foreach ($process->getNodes() as $node) {
77 foreach ($node->getDetectors() as $detector) {
79 if (!$detector->getActivated()) {
80 $all_triggered =
false;
83 foreach ($node->getEmitters() as $emitter) {
85 if (!$emitter->getActivated()) {
86 $all_triggered =
false;
90 $this->assertTrue($all_triggered,
'Not all nodes were triggered immediately on activation.');
94 public function test_WorkflowWithJoiningParallelGatewayShouldOutputAccordingly()
96 $test_name =
'ParallelGateway_Joining';
104 $this->assertTrue(substr($return, 0, 25) ==
'No syntax errors detected',
'Lint of output code failed.');
107 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
110 $process =
new $test_name;
111 $this->assertFalse($process->isActive());
113 $process->startWorkflow();
114 $all_triggered =
true;
115 foreach ($process->getNodes() as $node) {
117 foreach ($node->getDetectors() as $detector) {
119 if (!$detector->getActivated()) {
120 $all_triggered =
false;
123 foreach ($node->getEmitters() as $emitter) {
125 if (!$emitter->getActivated()) {
126 $all_triggered =
false;
130 $this->assertTrue($all_triggered);
134 public function test_WorkflowWithForkingParallelGatewayShouldOutputAccordingly()
136 $test_name =
'ParallelGateway_Forking';
144 $this->assertTrue(substr($return, 0, 25) ==
'No syntax errors detected',
'Lint of output code failed.');
147 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
150 $process =
new $test_name;
151 $this->assertFalse($process->isActive());
153 $process->startWorkflow();
154 $all_triggered =
true;
155 foreach ($process->getNodes() as $node) {
157 foreach ($node->getDetectors() as $detector) {
159 if (!$detector->getActivated()) {
160 $all_triggered =
false;
163 foreach ($node->getEmitters() as $emitter) {
165 if (!$emitter->getActivated()) {
166 $all_triggered =
false;
170 $this->assertTrue($all_triggered);
Class ilWorkflowEngineBaseTest.
getTestGoldsampleFilename($test_name)
getTestOutputFilename($test_name)
getTestInputFilename($test_name)