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_WorkflowWithSimpleIntermediateMessageEventShouldOutputAccordingly()
45 $this->markTestIncomplete(
46 '$ilDB throws notices during test.' 49 $test_name =
'IntermediateCatchEvent_Message_Simple';
57 $this->assertTrue(substr($return, 0, 25) ==
'No syntax errors detected',
'Lint of output code failed.');
60 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
62 require_once
'./Services/Database/classes/class.ilDB.php';
63 $ildb_mock = $this->createMock(
'ilDBMySQL', array(
'nextId',
'quote',
'exec',
'insert'), array(),
'',
false,
false);
64 $ildb_mock->expects($this->any())->method(
'quote')->will($this->returnCallback(
''));
66 $ildb_mock->expects($this->any())->method(
'nextId')->will($this->returnValue(
$i++));
67 $ildb_mock->expects($this->any())->method(
'exec')->will($this->returnValue(
true));
68 $ildb_mock->expects($this->any())->method(
'insert')->will($this->returnValue(
true));
81 $process =
new $test_name;
82 $process->startWorkflow();
83 $all_triggered =
true;
84 foreach ($process->getNodes() as $node) {
86 foreach ($node->getDetectors() as $detector) {
88 if (!$detector->getActivated()) {
89 $all_triggered =
false;
92 foreach ($node->getEmitters() as $emitter) {
94 if (!$emitter->getActivated()) {
95 $all_triggered =
false;
99 $this->assertFalse($all_triggered,
'All nodes were triggered (but should not since the event was not handled.');
101 $process->handleEvent(
112 $all_triggered =
true;
113 foreach ($process->getNodes() as $node) {
115 foreach ($node->getDetectors() as $detector) {
117 if (!$detector->getActivated()) {
118 $all_triggered =
false;
121 foreach ($node->getEmitters() as $emitter) {
123 if (!$emitter->getActivated()) {
124 $all_triggered =
false;
128 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
133 public function test_WorkflowWithSimpleIntermediateSignalEventShouldOutputAccordingly()
135 $this->markTestIncomplete(
136 '$ilDB throws notices during test.' 139 $test_name =
'IntermediateCatchEvent_Signal_Simple';
147 $this->assertTrue(substr($return, 0, 25) ==
'No syntax errors detected',
'Lint of output code failed.');
150 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
152 require_once
'./Services/Database/classes/class.ilDB.php';
153 $ildb_mock = $this->createMock(
'ilDBMySQL', array(
'nextId',
'quote',
'exec',
'insert'), array(),
'',
false,
false);
154 $ildb_mock->expects($this->any())->method(
'quote')->will($this->returnCallback(
''));
156 $ildb_mock->expects($this->any())->method(
'nextId')->will($this->returnValue(
$i++));
157 $ildb_mock->expects($this->any())->method(
'exec')->will($this->returnValue(
true));
158 $ildb_mock->expects($this->any())->method(
'insert')->will($this->returnValue(
true));
171 $process =
new $test_name;
172 $process->startWorkflow();
173 $all_triggered =
true;
174 foreach ($process->getNodes() as $node) {
176 foreach ($node->getDetectors() as $detector) {
178 if (!$detector->getActivated()) {
179 $all_triggered =
false;
182 foreach ($node->getEmitters() as $emitter) {
184 if (!$emitter->getActivated()) {
185 $all_triggered =
false;
189 $this->assertFalse($all_triggered,
'All nodes were triggered (but should not since the event was not handled.');
191 $process->handleEvent(
202 $all_triggered =
true;
203 foreach ($process->getNodes() as $node) {
205 foreach ($node->getDetectors() as $detector) {
207 if (!$detector->getActivated()) {
208 $all_triggered =
false;
211 foreach ($node->getEmitters() as $emitter) {
213 if (!$emitter->getActivated()) {
214 $all_triggered =
false;
218 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
223 public function test_WorkflowWithSimpleIntermediateTimerEventShouldOutputAccordingly()
225 $this->markTestIncomplete(
226 '$ilDB throws notices during test.' 228 $test_name =
'IntermediateCatchEvent_Timer_Simple';
236 $this->assertTrue(substr($return, 0, 25) ==
'No syntax errors detected',
'Lint of output code failed.');
239 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
241 require_once
'./Services/Database/classes/class.ilDB.php';
242 $ildb_mock = $this->createMock(
'ilDBMySQL', array(
'nextId',
'quote',
'exec',
'insert'), array(),
'',
false,
false);
243 $ildb_mock->expects($this->any())->method(
'quote')->will($this->returnCallback(
''));
245 $ildb_mock->expects($this->any())->method(
'nextId')->will($this->returnValue(
$i++));
246 $ildb_mock->expects($this->any())->method(
'exec')->will($this->returnValue(
true));
247 $ildb_mock->expects($this->any())->method(
'insert')->will($this->returnValue(
true));
260 $process =
new $test_name;
261 $process->startWorkflow();
262 $all_triggered =
true;
263 foreach ($process->getNodes() as $node) {
265 foreach ($node->getDetectors() as $detector) {
267 if (!$detector->getActivated()) {
268 $all_triggered =
false;
271 foreach ($node->getEmitters() as $emitter) {
273 if (!$emitter->getActivated()) {
274 $all_triggered =
false;
278 $this->assertFalse($all_triggered,
'All nodes were triggered (but should not since the event was not handled.');
280 $process->handleEvent(
291 $all_triggered =
true;
292 foreach ($process->getNodes() as $node) {
294 foreach ($node->getDetectors() as $detector) {
296 if (!$detector->getActivated()) {
297 $all_triggered =
false;
300 foreach ($node->getEmitters() as $emitter) {
302 if (!$emitter->getActivated()) {
303 $all_triggered =
false;
307 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
Class ilWorkflowEngineBaseTest.
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.