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 16 of file ilLoggingActivityTest.php.
◆ setUp()
ilLoggingActivityTest::setUp |
( |
| ) |
|
Definition at line 21 of file ilLoggingActivityTest.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.ilLoggingActivity.php';
48 $this->test_dir = vfs\vfsStream::setup(
'example');
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
◆ tearDown()
ilLoggingActivityTest::tearDown |
( |
| ) |
|
◆ testConstructorValidContext()
ilLoggingActivityTest::testConstructorValidContext |
( |
| ) |
|
◆ testExecute()
ilLoggingActivityTest::testExecute |
( |
| ) |
|
Definition at line 203 of file ilLoggingActivityTest.php.
207 $activity->setLogFile(vfs\vfsStream::url(
'example/log.txt'));
208 $activity->setLogLevel(
'MESSAGE');
209 $activity->setLogMessage(
'TEST');
212 $activity->execute();
215 $expected =
' :: MESSAGE :: TEST';
216 $fp = fopen(vfs\vfsStream::url(
'example/log.txt'),
'r');
218 $actual = substr($line, 25, strlen($line)-27);
223 'Logging Activity did not write expected output.'
◆ testGetContext()
ilLoggingActivityTest::testGetContext |
( |
| ) |
|
Definition at line 237 of file ilLoggingActivityTest.php.
243 $actual = $activity->getContext();
246 if ($actual === $this->node) {
247 $this->assertEquals($actual, $this->node);
249 $this->assertTrue(
false,
'Context not identical.');
◆ testPassInUnwriteablePath()
ilLoggingActivityTest::testPassInUnwriteablePath |
( |
| ) |
|
◆ testSetGetEmptyLogMessage()
ilLoggingActivityTest::testSetGetEmptyLogMessage |
( |
| ) |
|
◆ testSetGetIllegalExtensionLogFile()
ilLoggingActivityTest::testSetGetIllegalExtensionLogFile |
( |
| ) |
|
◆ testSetGetInvalidLogLevel()
ilLoggingActivityTest::testSetGetInvalidLogLevel |
( |
| ) |
|
◆ testSetGetLegalMessage()
ilLoggingActivityTest::testSetGetLegalMessage |
( |
| ) |
|
Definition at line 123 of file ilLoggingActivityTest.php.
127 $expected =
'Hallo Spencer!';
130 $activity->setLogMessage($expected);
131 $actual = $activity->getLogMessage();
137 'Get/Set corrupted message.'
◆ testSetGetNonWriteableLogFile()
ilLoggingActivityTest::testSetGetNonWriteableLogFile |
( |
| ) |
|
◆ testSetGetNullLogMessage()
ilLoggingActivityTest::testSetGetNullLogMessage |
( |
| ) |
|
◆ testSetGetValidLogFile()
ilLoggingActivityTest::testSetGetValidLogFile |
( |
| ) |
|
Definition at line 73 of file ilLoggingActivityTest.php.
77 $expected =
'./Services/WorkflowEngine/test/testlog.txt';
80 $activity->setLogFile($expected);
81 $actual = $activity->getLogFile();
86 'Valid log file was given, returned value differed.'
◆ testSetGetValidLogLevel()
ilLoggingActivityTest::testSetGetValidLogLevel |
( |
| ) |
|
Definition at line 171 of file ilLoggingActivityTest.php.
175 $expected =
"MESSAGE";
178 $activity->setLogLevel($expected);
179 $actual = $activity->getLogLevel();
185 'Get/Set corrupted log level.'
◆ $test_dir
ilLoggingActivityTest::$test_dir |
The documentation for this class was generated from the following file: