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(
'../../../../');
28 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
33 if (!
defined(
'IL_PHPUNIT_TEST'))
35 define(
'IL_PHPUNIT_TEST', FALSE);
40 require_once
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
44 require_once
'./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
48 $this->workflow->addNode($this->node);
50 require_once
'./Services/WorkflowEngine/classes/activities/class.ilLoggingActivity.php';
52 $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 208 of file ilLoggingActivityTest.php.
212 $activity->setLogFile(vfs\vfsStream::url(
'example/log.txt'));
213 $activity->setLogLevel(
'MESSAGE');
214 $activity->setLogMessage(
'TEST');
217 $activity->execute();
220 $expected =
' :: MESSAGE :: TEST';
221 $fp = fopen(vfs\vfsStream::url(
'example/log.txt'),
'r');
223 $actual = substr($line, 25, strlen($line)-27);
228 'Logging Activity did not write expected output.'
◆ testGetContext()
ilLoggingActivityTest::testGetContext |
( |
| ) |
|
Definition at line 242 of file ilLoggingActivityTest.php.
248 $actual = $activity->getContext();
251 if ($actual === $this->node)
253 $this->assertEquals($actual, $this->node);
255 $this->assertTrue(
false,
'Context not identical.');
◆ testPassInUnwriteablePath()
ilLoggingActivityTest::testPassInUnwriteablePath |
( |
| ) |
|
◆ testSetGetEmptyLogMessage()
ilLoggingActivityTest::testSetGetEmptyLogMessage |
( |
| ) |
|
◆ testSetGetIllegalExtensionLogFile()
ilLoggingActivityTest::testSetGetIllegalExtensionLogFile |
( |
| ) |
|
◆ testSetGetInvalidLogLevel()
ilLoggingActivityTest::testSetGetInvalidLogLevel |
( |
| ) |
|
◆ 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 |
( |
| ) |
|
◆ testSetGetNullLogMessage()
ilLoggingActivityTest::testSetGetNullLogMessage |
( |
| ) |
|
◆ testSetGetValidLogFile()
ilLoggingActivityTest::testSetGetValidLogFile |
( |
| ) |
|
Definition at line 78 of file ilLoggingActivityTest.php.
82 $expected =
'./Services/WorkflowEngine/test/testlog.txt';
85 $activity->setLogFile($expected);
86 $actual = $activity->getLogFile();
91 'Valid log file was given, returned value differed.'
◆ testSetGetValidLogLevel()
ilLoggingActivityTest::testSetGetValidLogLevel |
( |
| ) |
|
Definition at line 176 of file ilLoggingActivityTest.php.
180 $expected =
"MESSAGE";
183 $activity->setLogLevel($expected);
184 $actual = $activity->getLogLevel();
190 'Get/Set corrupted log level.'
◆ $test_dir
ilLoggingActivityTest::$test_dir |
The documentation for this class was generated from the following file: