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_WorkflowWithSimpleEventGatewayShouldOutputAccordingly()
41 $this->markTestIncomplete(
42 '$ilDB throws notices during test.' 45 $test_name =
'EventBasedGateway_Blanko_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.');
58 require_once
'./Services/Database/classes/class.ilDB.php';
59 $ildb_mock = $this->getMock(
'ilDBMySQL',
array(
'nextId',
'quote',
'exec',
'insert'),
array(),
'',
false,
false);
60 $ildb_mock->expects( $this->any() )->method(
'quote')->will( $this->returnCallback(
''));
62 $ildb_mock->expects( $this->any() )->method(
'nextId' )->will( $this->returnValue($i++) );
63 $ildb_mock->expects( $this->any() )->method(
'exec' )->will( $this->returnValue(
true) );
64 $ildb_mock->expects( $this->any() )->method(
'insert' )->will( $this->returnValue(
true) );
71 $process =
new $test_name;
72 $this->assertFalse($process->isActive());
74 $process->startWorkflow();
75 $this->assertTrue($process->isActive());
76 $all_triggered =
true;
77 foreach($process->getNodes() as $node)
80 foreach($node->getDetectors() as $detector)
83 if(!$detector->getActivated())
85 $all_triggered =
false;
88 foreach($node->getEmitters() as $emitter)
91 if(!$emitter->getActivated())
93 $all_triggered =
false;
97 $this->assertFalse($all_triggered,
'All nodes were triggered.');
98 $this->assertTrue($process->isActive());
99 $process->handleEvent(
110 $all_triggered =
true;
111 foreach($process->getNodes() as $node)
114 foreach($node->getDetectors() as $detector)
117 if(!$detector->getActivated())
119 $all_triggered =
false;
122 foreach($node->getEmitters() as $emitter)
125 if(!$emitter->getActivated())
127 $all_triggered =
false;
131 $this->assertFalse($all_triggered,
'All nodes were triggered.');
132 $all_inactive =
true;
133 foreach($process->getNodes() as $node)
135 if($node->isActive())
137 $all_inactive =
false;
140 $this->assertTrue($all_inactive,
'Not all nodes are inactive.');
141 $this->assertFalse($process->isActive(),
'Process should be inactive after processing the event. It is not.');
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.