ilScriptActivityTest is part of the workflow engine.
More...
ilScriptActivityTest is part of the workflow engine.
This class holds all tests for the class activities/class.ilScriptActivity
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 16 of file ilScriptActivityTest.php.
◆ setUp()
ilScriptActivityTest::setUp |
( |
| ) |
|
Definition at line 21 of file ilScriptActivityTest.php.
22 {
23 chdir( dirname ( __FILE__ ) );
24 chdir('../../../../');
25
26 try
27 {
28 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
29
30 }
31 catch ( Exception $exception )
32 {
33 if (!
defined(
'IL_PHPUNIT_TEST'))
34 {
35 define('IL_PHPUNIT_TEST', FALSE);
36 }
37 }
38
39
40 require_once './Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
42
43
44 require_once './Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
46
47
48 $this->workflow->addNode($this->node);
49
50 require_once './Services/WorkflowEngine/classes/activities/class.ilScriptActivity.php';
51
52 $this->test_dir = vfs\vfsStream::setup('example');
53 }
@noinspection PhpIncludeInspection
@noinspection PhpIncludeInspection
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
References defined.
◆ tearDown()
ilScriptActivityTest::tearDown |
( |
| ) |
|
◆ testConstructorValidContext()
ilScriptActivityTest::testConstructorValidContext |
( |
| ) |
|
Definition at line 65 of file ilScriptActivityTest.php.
66 {
67
69
70
71
72 $this->assertTrue(
73 true,
74 'Construction failed with valid context passed to constructor.'
75 );
76 }
@noinspection PhpIncludeInspection
◆ testGetContext()
ilScriptActivityTest::testGetContext |
( |
| ) |
|
Definition at line 78 of file ilScriptActivityTest.php.
79 {
80
82
83
84 $actual = $activity->getContext();
85
86
87 if ($actual === $this->node)
88 {
89 $this->assertEquals($actual, $this->node);
90 } else {
91 $this->assertTrue(false, 'Context not identical.');
92 }
93 }
◆ testSetGetMethod()
ilScriptActivityTest::testSetGetMethod |
( |
| ) |
|
Definition at line 95 of file ilScriptActivityTest.php.
96 {
97
99
100 $code =
"return 'Hallo, Welt!';";
101 $activity->setMethod(create_function(
null,
$code));
102
103
104 $response = $activity->getScript();
105
106
107 $this->assertEquals($response(), "Hallo, Welt!");
108 }
References $code.
◆ $test_dir
ilScriptActivityTest::$test_dir |
The documentation for this class was generated from the following file: