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_WorkflowWithSimpleDataInputShouldOutputAccordingly()
45 $test_name =
'DataInput_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 $process->setInstanceVarById(
'DataInput_1',
'YaddaYadda');
62 $process->startWorkflow();
63 $all_triggered =
true;
64 foreach ($process->getNodes() as $node) {
66 foreach ($node->getDetectors() as $detector) {
68 if (!$detector->getActivated()) {
69 $all_triggered =
false;
72 foreach ($node->getEmitters() as $emitter) {
74 if (!$emitter->getActivated()) {
75 $all_triggered =
false;
79 $this->assertEquals(
'YaddaYadda', $process->getInstanceVarById(
'DataInput_1'),
'Inputvar was not kept.');
80 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
85 public function test_WorkflowWithDataInputPropertiesShouldOutputAccordingly()
87 $test_name =
'DataInput_WithProperties';
95 $this->assertTrue(substr($return, 0, 25) ==
'No syntax errors detected',
'Lint of output code failed.');
98 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
102 $process =
new $test_name;
103 $process->setInstanceVarById(
'DataInput_1',
'YaddaYadda');
104 $process->startWorkflow();
105 $all_triggered =
true;
106 foreach ($process->getNodes() as $node) {
108 foreach ($node->getDetectors() as $detector) {
110 if (!$detector->getActivated()) {
111 $all_triggered =
false;
114 foreach ($node->getEmitters() as $emitter) {
116 if (!$emitter->getActivated()) {
117 $all_triggered =
false;
121 $this->assertEquals(
'YaddaYadda', $process->getInstanceVarById(
'DataInput_1'),
'Inputvar was not kept.');
122 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
127 public function test_WorkflowWithRepositoryObjectSelectorShouldOutputAccordingly()
129 $test_name =
'DataInput_RepositoryObjectSelector';
137 $this->assertTrue(substr($return, 0, 25) ==
'No syntax errors detected',
'Lint of output code failed.');
140 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
144 $process =
new $test_name;
145 $process->setInstanceVarById(
'DataInput_1',
'YaddaYadda');
146 $process->startWorkflow();
147 $all_triggered =
true;
148 foreach ($process->getNodes() as $node) {
150 foreach ($node->getDetectors() as $detector) {
152 if (!$detector->getActivated()) {
153 $all_triggered =
false;
156 foreach ($node->getEmitters() as $emitter) {
158 if (!$emitter->getActivated()) {
159 $all_triggered =
false;
163 $this->assertEquals(
'YaddaYadda', $process->getInstanceVarById(
'DataInput_1'),
'Inputvar was not kept.');
164 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
Class ilWorkflowEngineBaseTest.