23        chdir(dirname(__FILE__));
 
   24        chdir(
'../../../../');
 
   27            include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
 
   29        } 
catch (Exception $exception) {
 
   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.ilEventRaisingActivity.php';
 
   48        $this->test_dir = vfs\vfsStream::setup(
'example');
 
   69            'Construction failed with valid context passed to constructor.' 
   77        $expected = 
'HokusPokus';
 
   80        $activity->setEventName($expected);
 
   81        $actual = $activity->getEventName();
 
   86            'Retrieved EventName differs from input value.' 
   94        $expected = 
'HokusPokus';
 
   97        $activity->setEventType($expected);
 
   98        $actual = $activity->getEventType();
 
  103            'Retrieved EventType differs from input value.' 
  113        $actual = $activity->getContext();
 
  116        if ($actual === $this->node) {
 
  117            $this->assertEquals($actual, $this->node);
 
  119            $this->assertTrue(
false, 
'Context not identical.');
 
  129        $expected[] = array(
'key' => 
$key, 
'value' => $value);
 
  130        $expected[] = array(
'key' => 
'context', 
'value' => $activity);
 
  133        $activity->addFixedParam(
$key, $value);
 
  134        $params = $activity->getParamsArray();
 
  137        $this->assertEquals($expected, 
$params);
 
  150        $expected[] = array(
'key' => $key1, 
'value' => $value1);
 
  151        $expected[] = array(
'key' => $key2, 
'value' => $value2);
 
  152        $expected[] = array(
'key' => $key3, 
'value' => $value3);
 
  153        $expected[] = array(
'key' => 
'context', 
'value' => $activity);
 
  156        $activity->addFixedParam($key1, $value1);
 
  157        $activity->addFixedParam($key2, $value2);
 
  158        $activity->addFixedParam($key3, $value3);
 
  159        $params = $activity->getParamsArray();
 
  162        $this->assertEquals($expected, 
$params);
 
  167        $this->markTestIncomplete(
'Needs further investigation. $ilDB->quote vs. mock.');
 
  170        $activity->setEventName(
'EVTName');
 
  171        $activity->setEventType(
'EVTType');
 
  174        $expected[] = array(
'key' => 
$key, 
'value' => $value);
 
  175        $expected[] = array(
'key' => 
'context', 
'value' => $activity);
 
  177        $activity->addFixedParam(
$key, $value);
 
  179        $appHandlerMock = $this->getMockBuilder(
'ilAppEventHandler', 
'getParamsArray')
 
  180                           ->setMethods(array(
'raise'))
 
  183        $appHandlerMock->expects($this->once())
 
  186                           $this->equalTo(
'EVTType'),
 
  187                           $this->equalTo(
'EVTName'),
 
  188                           $this->equalTo($expected)
 
  190        $GLOBALS[
'ilAppEventHandler'] = $appHandlerMock;
 
  191        $activity->execute();
 
An exception for terminatinating execution or to throw for unit testing.
@noinspection PhpIncludeInspection
@noinspection PhpIncludeInspection
ilEventRaisingActivityTest is part of the workflow engine.
testSetGetEventNameShouldReturnSetValue()
testConstructorValidContext()
$test_dir
vfsStream Test Directory, see setup.
testSetGetFixedParamsMultiplePairs()
testSetGetFixedParamsSinglePair()
testSetGetEventTypeShouldReturnSetValue()
@noinspection PhpIncludeInspection
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'