23 chdir( dirname ( __FILE__ ) );
24 chdir(
'../../../../');
28 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
33 if (!
defined(
'IL_PHPUNIT_TEST'))
35 define(
'IL_PHPUNIT_TEST', FALSE);
40 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
44 require_once
'./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
48 $this->workflow->addNode($this->node);
50 require_once
'./Services/WorkflowEngine/classes/activities/class.ilEventRaisingActivity.php';
52 $this->test_dir = vfs\vfsStream::setup(
'example');
58 if ($ilSetting != NULL)
74 'Construction failed with valid context passed to constructor.' 82 $expected =
'HokusPokus';
85 $activity->setEventName($expected);
86 $actual = $activity->getEventName();
91 'Retrieved EventName differs from input value.' 99 $expected =
'HokusPokus';
102 $activity->setEventType($expected);
103 $actual = $activity->getEventType();
108 'Retrieved EventType differs from input value.' 118 $actual = $activity->getContext();
121 if ($actual === $this->node)
123 $this->assertEquals($actual, $this->node);
125 $this->assertTrue(
false,
'Context not identical.');
135 $expected[] =
array(
'key' => $key,
'value' => $value);
136 $expected[] =
array(
'key' =>
'context',
'value' => $activity);
139 $activity->addFixedParam($key, $value);
140 $params = $activity->getParamsArray();
143 $this->assertEquals($expected,
$params);
156 $expected[] =
array(
'key' => $key1,
'value' => $value1);
157 $expected[] =
array(
'key' => $key2,
'value' => $value2);
158 $expected[] =
array(
'key' => $key3,
'value' => $value3);
159 $expected[] =
array(
'key' =>
'context',
'value' => $activity);
162 $activity->addFixedParam($key1, $value1);
163 $activity->addFixedParam($key2, $value2);
164 $activity->addFixedParam($key3, $value3);
165 $params = $activity->getParamsArray();
168 $this->assertEquals($expected,
$params);
173 $this->markTestIncomplete(
'Needs further investigation. $ilDB->quote vs. mock.');
176 $activity->setEventName(
'EVTName');
177 $activity->setEventType(
'EVTType');
180 $expected[] =
array(
'key' => $key,
'value' => $value);
181 $expected[] =
array(
'key' =>
'context',
'value' => $activity);
183 $activity->addFixedParam($key, $value);
185 $appHandlerMock = $this->getMockBuilder(
'ilAppEventHandler',
'getParamsArray')
186 ->setMethods(
array(
'raise'))
189 $appHandlerMock->expects($this->once())
192 $this->equalTo(
'EVTType'),
193 $this->equalTo(
'EVTName'),
194 $this->equalTo($expected)
196 $GLOBALS[
'ilAppEventHandler'] = $appHandlerMock;
197 $activity->execute();
testConstructorValidContext()
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
testSetGetFixedParamsMultiplePairs()
$test_dir
vfsStream Test Directory, see setup.
Create styles array
The data for the language used.
testSetGetFixedParamsSinglePair()
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
testSetGetEventTypeShouldReturnSetValue()
ilEventRaisingActivityTest is part of the workflow engine.
testSetGetEventNameShouldReturnSetValue()