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_WorkflowWithSimpleIntermediateThrowSignalEventShouldOutputAccordingly()
41 $test_name =
'IntermediateThrowEvent_Signal_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.');
55 $ilappeventhandler_mock = $this->getMock(
'ilAppEventHandler',
array(
'raise'),
array(),
'',
false,
false);
56 $ilappeventhandler_mock
57 ->expects( $this->once() )
59 ->will( $this->returnValue(
true) );
61 global $ilAppEventHandler;
62 $ilAppEventHandler = $ilappeventhandler_mock;
63 $GLOBALS[
'ilAppEventHandler'] = $ilappeventhandler_mock;
66 $process =
new $test_name;
67 $process->startWorkflow();
68 $all_triggered =
true;
69 foreach($process->getNodes() as $node)
72 foreach($node->getDetectors() as $detector)
75 if(!$detector->getActivated())
77 $all_triggered =
false;
80 foreach($node->getEmitters() as $emitter)
83 if(!$emitter->getActivated())
85 $all_triggered =
false;
89 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
94 public function test_WorkflowWithSimpleIntermediateThrowMessageEventShouldOutputAccordingly()
96 $test_name =
'IntermediateThrowEvent_Message_Simple';
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.');
109 $ilappeventhandler_mock = $this->getMock(
'ilAppEventHandler',
array(
'raise'),
array(),
'',
false,
false);
110 $ilappeventhandler_mock
111 ->expects( $this->once() )
113 ->will( $this->returnValue(
true) );
116 global $ilAppEventHandler;
117 $ilAppEventHandler = $ilappeventhandler_mock;
118 $GLOBALS[
'ilAppEventHandler'] = $ilappeventhandler_mock;
121 $process =
new $test_name;
122 $process->startWorkflow();
123 $all_triggered =
true;
124 foreach($process->getNodes() as $node)
127 foreach($node->getDetectors() as $detector)
130 if(!$detector->getActivated())
132 $all_triggered =
false;
135 foreach($node->getEmitters() as $emitter)
138 if(!$emitter->getActivated())
140 $all_triggered =
false;
144 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.