ilStaticMethodCallActivityTest is part of the petri net based workflow engine.
More...
ilStaticMethodCallActivityTest is part of the petri net based workflow engine.
This class holds all tests for the class activities/class.ilStaticMethodCallActivity
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 15 of file ilStaticMethodCallActivityTest.php.
◆ executionTargetMethod()
static ilStaticMethodCallActivityTest::executionTargetMethod |
( |
|
$context, |
|
|
|
$param |
|
) |
| |
|
static |
Definition at line 118 of file ilStaticMethodCallActivityTest.php.
119 {
120 $parameters = array(
121 'homer' => 'homer', 0 => 'homer',
122 'marge' => 'marge', 1 => 'marge',
123 'bart' => 'bart', 2 => 'bart',
124 'lisa' => 'lisa', 3 => 'lisa',
125 'maggy' => 'maggy', 4 => 'maggy'
126 );
127
129 throw new Exception('Something went wrong with the context.');
130 }
131
132 if (
$param[0] != $parameters) {
133 throw new Exception('Something went wrong with the parameters.');
134 }
135
136 return true;
137 }
References $context, and $param.
◆ setUp()
ilStaticMethodCallActivityTest::setUp |
( |
| ) |
|
Reimplemented from ilWorkflowEngineBaseTest.
Definition at line 17 of file ilStaticMethodCallActivityTest.php.
17 : void
18 {
20
21
22 require_once './Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
24
25
26 require_once './Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
28
29
30 $this->workflow->addNode($this->node);
31
32 require_once './Services/WorkflowEngine/classes/activities/class.ilStaticMethodCallActivity.php';
33 }
@noinspection PhpIncludeInspection
@noinspection PhpIncludeInspection
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
References ILIAS\GlobalScreen\Provider\__construct().
◆ tearDown()
ilStaticMethodCallActivityTest::tearDown |
( |
| ) |
|
◆ testConstructorValidContext()
ilStaticMethodCallActivityTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 45 of file ilStaticMethodCallActivityTest.php.
46 {
47
49
50
51
52 $this->assertTrue(
53 true,
54 'Construction failed with valid context passed to constructor.'
55 );
56 }
@noinspection PhpIncludeInspection
◆ testExecute()
ilStaticMethodCallActivityTest::testExecute |
( |
| ) |
|
Definition at line 100 of file ilStaticMethodCallActivityTest.php.
101 {
102
104 $file = 'Services/WorkflowEngine/test/activities/ilStaticMethodCallActivityTest.php';
105 $class_and_method = 'ilStaticMethodCallActivityTest::executionTargetMethod';
106 $parameters = array('homer', 'marge', 'bart', 'lisa', 'maggy');
107
108
109 $activity->setIncludeFilename($file);
110 $activity->setClassAndMethodName($class_and_method);
111 $activity->setParameters($parameters);
112 $activity->execute();
113
114
115 $this->assertTrue(true, 'There dont seem to be problems here.');
116 }
◆ testGetContext()
ilStaticMethodCallActivityTest::testGetContext |
( |
| ) |
|
Definition at line 139 of file ilStaticMethodCallActivityTest.php.
140 {
141
143
144
145 $actual = $activity->getContext();
146
147
148 if ($actual === $this->node) {
149 $this->assertEquals($actual, $this->node);
150 } else {
151 $this->assertTrue(false, 'Context not identical.');
152 }
153 }
◆ testSetGetClassAndMethodName()
ilStaticMethodCallActivityTest::testSetGetClassAndMethodName |
( |
| ) |
|
Definition at line 72 of file ilStaticMethodCallActivityTest.php.
73 {
74
76 $expected = 'ilWorkflowUtils::targetMethod';
77
78
79 $activity->setClassAndMethodName($expected);
80 $actual = $activity->getClassAndMethodName();
81
82
83 $this->assertEquals($actual, $expected);
84 }
◆ testSetGetIncludeFilename()
ilStaticMethodCallActivityTest::testSetGetIncludeFilename |
( |
| ) |
|
Definition at line 58 of file ilStaticMethodCallActivityTest.php.
59 {
60
62 $expected = 'Services/WorkflowEngine/classes/utils/class.ilWorkflowUtils.php';
63
64
65 $activity->setIncludeFilename($expected);
66 $actual = $activity->getIncludeFilename();
67
68
69 $this->assertEquals($actual, $expected);
70 }
◆ testSetGetParameters()
ilStaticMethodCallActivityTest::testSetGetParameters |
( |
| ) |
|
Definition at line 86 of file ilStaticMethodCallActivityTest.php.
87 {
88
90 $expected = array('homer', 'marge', 'bart', 'lisa', 'maggy');
91
92
93 $activity->setParameters($expected);
94 $actual = $activity->getParameters();
95
96
97 $this->assertEquals($actual, $expected);
98 }
The documentation for this class was generated from the following file: