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_WorkflowWithSimpleEventGatewayShouldOutputAccordingly()
45 $this->markTestIncomplete(
46 '$ilDB throws notices during test.' 49 $test_name =
'EventBasedGateway_Blanko_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));
75 $process =
new $test_name;
76 $this->assertFalse($process->isActive());
78 $process->startWorkflow();
79 $this->assertTrue($process->isActive());
80 $all_triggered =
true;
81 foreach ($process->getNodes() as $node) {
83 foreach ($node->getDetectors() as $detector) {
85 if (!$detector->getActivated()) {
86 $all_triggered =
false;
89 foreach ($node->getEmitters() as $emitter) {
91 if (!$emitter->getActivated()) {
92 $all_triggered =
false;
96 $this->assertFalse($all_triggered,
'All nodes were triggered.');
97 $this->assertTrue($process->isActive());
98 $process->handleEvent(
109 $all_triggered =
true;
110 foreach ($process->getNodes() as $node) {
112 foreach ($node->getDetectors() as $detector) {
114 if (!$detector->getActivated()) {
115 $all_triggered =
false;
118 foreach ($node->getEmitters() as $emitter) {
120 if (!$emitter->getActivated()) {
121 $all_triggered =
false;
125 $this->assertFalse($all_triggered,
'All nodes were triggered.');
126 $all_inactive =
true;
127 foreach ($process->getNodes() as $node) {
128 if ($node->isActive()) {
129 $all_inactive =
false;
132 $this->assertTrue($all_inactive,
'Not all nodes are inactive.');
133 $this->assertFalse($process->isActive(),
'Process should be inactive after processing the event. It is not.');
Class ilWorkflowEngineBaseTest.
getTestInputFilename($test_name)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
getTestOutputFilename($test_name)
getTestGoldsampleFilename($test_name)
Create styles array
The data for the language used.