ilEventRaisingActivityTest is part of the workflow engine.
More...
ilEventRaisingActivityTest is part of the workflow engine.
This class holds all tests for the class activities/class.ilEventRaisingActivity
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 16 of file ilEventRaisingActivityTest.php.
◆ setUp()
ilEventRaisingActivityTest::setUp |
( |
| ) |
|
Definition at line 21 of file ilEventRaisingActivityTest.php.
References defined.
23 chdir(dirname(__FILE__));
24 chdir(
'../../../../');
27 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
30 if (!
defined(
'IL_PHPUNIT_TEST')) {
31 define(
'IL_PHPUNIT_TEST',
false);
36 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
40 require_once
'./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
44 $this->workflow->addNode($this->node);
46 require_once
'./Services/WorkflowEngine/classes/activities/class.ilEventRaisingActivity.php';
48 $this->test_dir = vfs\vfsStream::setup(
'example');
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
◆ tearDown()
ilEventRaisingActivityTest::tearDown |
( |
| ) |
|
◆ testConstructorValidContext()
ilEventRaisingActivityTest::testConstructorValidContext |
( |
| ) |
|
◆ testExecute()
ilEventRaisingActivityTest::testExecute |
( |
| ) |
|
Definition at line 165 of file ilEventRaisingActivityTest.php.
References $GLOBALS, $key, and array.
167 $this->markTestIncomplete(
'Needs further investigation. $ilDB->quote vs. mock.');
170 $activity->setEventName(
'EVTName');
171 $activity->setEventType(
'EVTType');
174 $expected[] =
array(
'key' =>
$key,
'value' => $value);
175 $expected[] =
array(
'key' =>
'context',
'value' => $activity);
177 $activity->addFixedParam(
$key, $value);
179 $appHandlerMock = $this->getMockBuilder(
'ilAppEventHandler',
'getParamsArray')
180 ->setMethods(
array(
'raise'))
183 $appHandlerMock->expects($this->once())
186 $this->equalTo(
'EVTType'),
187 $this->equalTo(
'EVTName'),
188 $this->equalTo($expected)
190 $GLOBALS[
'ilAppEventHandler'] = $appHandlerMock;
191 $activity->execute();
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
◆ testGetContext()
ilEventRaisingActivityTest::testGetContext |
( |
| ) |
|
Definition at line 107 of file ilEventRaisingActivityTest.php.
113 $actual = $activity->getContext();
116 if ($actual === $this->node) {
117 $this->assertEquals($actual, $this->node);
119 $this->assertTrue(
false,
'Context not identical.');
◆ testSetGetEventNameShouldReturnSetValue()
ilEventRaisingActivityTest::testSetGetEventNameShouldReturnSetValue |
( |
| ) |
|
Definition at line 73 of file ilEventRaisingActivityTest.php.
77 $expected =
'HokusPokus';
80 $activity->setEventName($expected);
81 $actual = $activity->getEventName();
86 'Retrieved EventName differs from input value.'
◆ testSetGetEventTypeShouldReturnSetValue()
ilEventRaisingActivityTest::testSetGetEventTypeShouldReturnSetValue |
( |
| ) |
|
Definition at line 90 of file ilEventRaisingActivityTest.php.
94 $expected =
'HokusPokus';
97 $activity->setEventType($expected);
98 $actual = $activity->getEventType();
103 'Retrieved EventType differs from input value.'
◆ testSetGetFixedParamsMultiplePairs()
ilEventRaisingActivityTest::testSetGetFixedParamsMultiplePairs |
( |
| ) |
|
Definition at line 140 of file ilEventRaisingActivityTest.php.
References $params, and array.
150 $expected[] =
array(
'key' => $key1,
'value' => $value1);
151 $expected[] =
array(
'key' => $key2,
'value' => $value2);
152 $expected[] =
array(
'key' => $key3,
'value' => $value3);
153 $expected[] =
array(
'key' =>
'context',
'value' => $activity);
156 $activity->addFixedParam($key1, $value1);
157 $activity->addFixedParam($key2, $value2);
158 $activity->addFixedParam($key3, $value3);
159 $params = $activity->getParamsArray();
162 $this->assertEquals($expected,
$params);
Create styles array
The data for the language used.
◆ testSetGetFixedParamsSinglePair()
ilEventRaisingActivityTest::testSetGetFixedParamsSinglePair |
( |
| ) |
|
Definition at line 123 of file ilEventRaisingActivityTest.php.
References $key, $params, and array.
129 $expected[] =
array(
'key' =>
$key,
'value' => $value);
130 $expected[] =
array(
'key' =>
'context',
'value' => $activity);
133 $activity->addFixedParam(
$key, $value);
134 $params = $activity->getParamsArray();
137 $this->assertEquals($expected,
$params);
Create styles array
The data for the language used.
◆ $test_dir
ilEventRaisingActivityTest::$test_dir |
The documentation for this class was generated from the following file: