ilLoggingActivityTest is part of the petri net based workflow engine.
More...
ilLoggingActivityTest is part of the petri net based workflow engine.
This class holds all tests for the class activities/class.ilLoggingActivity
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
/
Definition at line 17 of file ilLoggingActivityTest.php.
◆ setUp()
ilLoggingActivityTest::setUp |
( |
| ) |
|
Definition at line 22 of file ilLoggingActivityTest.php.
24 chdir(dirname(__FILE__));
25 chdir(
'../../../../');
28 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
31 if (!defined(
'IL_PHPUNIT_TEST')) {
32 define(
'IL_PHPUNIT_TEST',
false);
37 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
41 require_once
'./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
45 $this->workflow->addNode($this->node);
47 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
49 $this->test_dir = vfs\vfsStream::setup(
'example');
◆ tearDown()
ilLoggingActivityTest::tearDown |
( |
| ) |
|
◆ testConstructorValidContext()
ilLoggingActivityTest::testConstructorValidContext |
( |
| ) |
|
◆ testExecute()
ilLoggingActivityTest::testExecute |
( |
| ) |
|
Definition at line 214 of file ilLoggingActivityTest.php.
218 $activity->setLogFile(vfs\vfsStream::url(
'example/log.txt'));
219 $activity->setLogLevel(
'MESSAGE');
220 $activity->setLogMessage(
'TEST');
223 $activity->execute();
226 $expected =
' :: MESSAGE :: TEST';
227 $fp = fopen(vfs\vfsStream::url(
'example/log.txt'),
'r');
229 $actual = substr($line, 25, strlen($line) - 27);
234 'Logging Activity did not write expected output.'
◆ testGetContext()
ilLoggingActivityTest::testGetContext |
( |
| ) |
|
Definition at line 250 of file ilLoggingActivityTest.php.
256 $actual = $activity->getContext();
259 if ($actual === $this->node) {
260 $this->assertEquals($actual, $this->node);
262 $this->assertTrue(
false,
'Context not identical.');
◆ testPassInUnwriteablePath()
ilLoggingActivityTest::testPassInUnwriteablePath |
( |
| ) |
|
Definition at line 241 of file ilLoggingActivityTest.php.
243 $this->expectException(ilWorkflowFilesystemException::class);
247 $activity->setLogFile(vfs\vfsStream::url(
'example.txt'));
◆ testSetGetEmptyLogMessage()
ilLoggingActivityTest::testSetGetEmptyLogMessage |
( |
| ) |
|
Definition at line 166 of file ilLoggingActivityTest.php.
168 $this->expectException(ilWorkflowObjectStateException::class);
174 $activity->setLogMessage(
'');
175 $actual = $activity->getLogMessage();
◆ testSetGetIllegalExtensionLogFile()
ilLoggingActivityTest::testSetGetIllegalExtensionLogFile |
( |
| ) |
|
Definition at line 112 of file ilLoggingActivityTest.php.
114 $this->expectException(ilWorkflowObjectStateException::class);
118 $expected =
'./Services/WorkflowEngine/test/malicious.php';
122 $activity->setLogFile($expected);
123 $actual = $activity->getLogFile();
◆ testSetGetInvalidLogLevel()
ilLoggingActivityTest::testSetGetInvalidLogLevel |
( |
| ) |
|
Definition at line 201 of file ilLoggingActivityTest.php.
203 $this->expectException(ilWorkflowObjectStateException::class);
207 $expected =
"guenther";
210 $activity->setLogLevel($expected);
211 $actual = $activity->getLogLevel();
◆ testSetGetLegalMessage()
ilLoggingActivityTest::testSetGetLegalMessage |
( |
| ) |
|
Definition at line 128 of file ilLoggingActivityTest.php.
132 $expected =
'Hallo Spencer!';
135 $activity->setLogMessage($expected);
136 $actual = $activity->getLogMessage();
142 'Get/Set corrupted message.'
◆ testSetGetNonWriteableLogFile()
ilLoggingActivityTest::testSetGetNonWriteableLogFile |
( |
| ) |
|
Definition at line 94 of file ilLoggingActivityTest.php.
96 $this->expectException(ilWorkflowFilesystemException::class);
100 $expected =
'/dev/ilias_unit_test_log_file_can_be_deleted_safely.txt';
103 $activity->setLogFile($expected);
104 $actual = $activity->getLogFile();
◆ testSetGetNullLogMessage()
ilLoggingActivityTest::testSetGetNullLogMessage |
( |
| ) |
|
Definition at line 149 of file ilLoggingActivityTest.php.
151 $this->expectException(ilWorkflowObjectStateException::class);
157 $activity->setLogMessage(null);
158 $actual = $activity->getLogMessage();
◆ testSetGetValidLogFile()
ilLoggingActivityTest::testSetGetValidLogFile |
( |
| ) |
|
Definition at line 74 of file ilLoggingActivityTest.php.
78 $expected =
'./Services/WorkflowEngine/test/testlog.txt';
81 $activity->setLogFile($expected);
82 $actual = $activity->getLogFile();
87 'Valid log file was given, returned value differed.'
◆ testSetGetValidLogLevel()
ilLoggingActivityTest::testSetGetValidLogLevel |
( |
| ) |
|
Definition at line 180 of file ilLoggingActivityTest.php.
184 $expected =
"MESSAGE";
187 $activity->setLogLevel($expected);
188 $actual = $activity->getLogLevel();
194 'Get/Set corrupted log level.'
◆ $test_dir
ilLoggingActivityTest::$test_dir |
The documentation for this class was generated from the following file: