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 119 of file ilStaticMethodCallActivityTest.php.
120 {
121 $parameters = array('homer' => 'homer', 'marge' => 'marge', 'bart' => 'bart', 'lisa' => 'lisa', 'maggy' => 'maggy');
122
123 if ($context == null)
124 {
125 throw new Exception('Something went wrong with the context.');
126 }
127
128 if ($param[0] != $parameters)
129 {
130 throw new Exception('Something went wrong with the parameters.');
131 }
132
133 return true;
134 }
◆ setUp()
ilStaticMethodCallActivityTest::setUp |
( |
| ) |
|
Definition at line 17 of file ilStaticMethodCallActivityTest.php.
18 {
19 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
20
21
22
23 require_once './Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
25
26
27 require_once './Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
29
30
31 $this->workflow->addNode($this->node);
32
33 require_once './Services/WorkflowEngine/classes/activities/class.ilStaticMethodCallActivity.php';
34 }
@noinspection PhpIncludeInspection
@noinspection PhpIncludeInspection
◆ tearDown()
ilStaticMethodCallActivityTest::tearDown |
( |
| ) |
|
◆ testConstructorValidContext()
ilStaticMethodCallActivityTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 46 of file ilStaticMethodCallActivityTest.php.
47 {
48
50
51
52
53 $this->assertTrue(
54 true,
55 'Construction failed with valid context passed to constructor.'
56 );
57 }
@noinspection PhpIncludeInspection
◆ testExecute()
ilStaticMethodCallActivityTest::testExecute |
( |
| ) |
|
Definition at line 101 of file ilStaticMethodCallActivityTest.php.
102 {
103
105 $file =
'Services/WorkflowEngine/test/activities/ilStaticMethodCallActivityTest.php';
106 $class_and_method = 'ilStaticMethodCallActivityTest::executionTargetMethod';
107 $parameters = array('homer', 'marge', 'bart', 'lisa', 'maggy');
108
109
110 $activity->setIncludeFilename(
$file);
111 $activity->setClassAndMethodName($class_and_method);
112 $activity->setParameters($parameters);
113 $activity->execute();
114
115
116 $this->assertTrue(true, 'There dont seem to be problems here.');
117 }
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
References $file.
◆ testGetContext()
ilStaticMethodCallActivityTest::testGetContext |
( |
| ) |
|
Definition at line 136 of file ilStaticMethodCallActivityTest.php.
137 {
138
140
141
142 $actual = $activity->getContext();
143
144
145 if ($actual === $this->node)
146 {
147 $this->assertEquals($actual, $this->node);
148 } else {
149 $this->assertTrue(false, 'Context not identical.');
150 }
151 }
◆ testSetGetClassAndMethodName()
ilStaticMethodCallActivityTest::testSetGetClassAndMethodName |
( |
| ) |
|
Definition at line 73 of file ilStaticMethodCallActivityTest.php.
74 {
75
77 $expected = 'ilWorkflowUtils::targetMethod';
78
79
80 $activity->setClassAndMethodName($expected);
81 $actual = $activity->getClassAndMethodName();
82
83
84 $this->assertEquals($actual, $expected);
85 }
◆ testSetGetIncludeFilename()
ilStaticMethodCallActivityTest::testSetGetIncludeFilename |
( |
| ) |
|
Definition at line 59 of file ilStaticMethodCallActivityTest.php.
60 {
61
63 $expected = 'Services/WorkflowEngine/classes/utils/class.ilWorkflowUtils.php';
64
65
66 $activity->setIncludeFilename($expected);
67 $actual = $activity->getIncludeFilename();
68
69
70 $this->assertEquals($actual, $expected);
71 }
◆ testSetGetParameters()
ilStaticMethodCallActivityTest::testSetGetParameters |
( |
| ) |
|
Definition at line 87 of file ilStaticMethodCallActivityTest.php.
88 {
89
91 $expected = array('homer', 'marge', 'bart', 'lisa', 'maggy');
92
93
94 $activity->setParameters($expected);
95 $actual = $activity->getParameters();
96
97
98 $this->assertEquals($actual, $expected);
99 }
The documentation for this class was generated from the following file: