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_WorkflowWithSimpleIntermediateThrowSignalEventShouldOutputAccordingly()
45 $test_name =
'IntermediateThrowEvent_Signal_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.');
59 $ilappeventhandler_mock = $this->createMock(
'ilAppEventHandler', array(
'raise'), array(),
'',
false,
false);
60 $ilappeventhandler_mock
61 ->expects($this->
once())
63 ->will($this->returnValue(
true));
65 global $ilAppEventHandler;
66 $ilAppEventHandler = $ilappeventhandler_mock;
67 $GLOBALS[
'ilAppEventHandler'] = $ilappeventhandler_mock;
70 $process =
new $test_name;
71 $process->startWorkflow();
72 $all_triggered =
true;
73 foreach ($process->getNodes() as $node) {
75 foreach ($node->getDetectors() as $detector) {
77 if (!$detector->getActivated()) {
78 $all_triggered =
false;
81 foreach ($node->getEmitters() as $emitter) {
83 if (!$emitter->getActivated()) {
84 $all_triggered =
false;
88 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
93 public function test_WorkflowWithSimpleIntermediateThrowMessageEventShouldOutputAccordingly()
95 $test_name =
'IntermediateThrowEvent_Message_Simple';
103 $this->assertTrue(substr($return, 0, 25) ==
'No syntax errors detected',
'Lint of output code failed.');
106 $this->assertEquals($goldsample,
$parse_result,
'Output does not match goldsample.');
108 $ilappeventhandler_mock = $this->createMock(
'ilAppEventHandler', array(
'raise'), array(),
'',
false,
false);
109 $ilappeventhandler_mock
110 ->expects($this->
once())
112 ->will($this->returnValue(
true));
115 global $ilAppEventHandler;
116 $ilAppEventHandler = $ilappeventhandler_mock;
117 $GLOBALS[
'ilAppEventHandler'] = $ilappeventhandler_mock;
120 $process =
new $test_name;
121 $process->startWorkflow();
122 $all_triggered =
true;
123 foreach ($process->getNodes() as $node) {
125 foreach ($node->getDetectors() as $detector) {
127 if (!$detector->getActivated()) {
128 $all_triggered =
false;
131 foreach ($node->getEmitters() as $emitter) {
133 if (!$emitter->getActivated()) {
134 $all_triggered =
false;
138 $this->assertTrue($all_triggered,
'Not all nodes were triggered.');
Class ilWorkflowEngineBaseTest.
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.