19                include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
 
   23                require_once 
'./Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
 
   27                require_once 
'./Services/WorkflowEngine/classes/nodes/class.ilBasicNode.php';
 
   31                $this->workflow->addNode($this->node);
 
   33                require_once 
'./Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
 
   42                        $ilSetting->delete( 
'IL_PHPUNIT_TEST_MICROTIME' );
 
   55                        'Construction failed with valid context passed to constructor.' 
   65                $workflow->addNode($node);
 
   69                $detector->setDetectorState(
true);
 
   75                if (!$detector->getDetectorState())
 
   80                if ($node->isActive())
 
   89                $this->assertTrue($valid_state, 
'Invalid state after setting of detector state.');
 
   98                $workflow->addNode($node);
 
  102                $detector->trigger(
null);
 
  107                if (!$detector->getDetectorState())
 
  109                        $valid_state = 
false;
 
  112                if ($node->isActive())
 
  118                        $valid_state = 
false;
 
  121                $this->assertTrue($valid_state, 
'Invalid state after setting of detector state.');
 
  130                $actual = $detector->getContext();
 
  133                if ($actual === $this->node)
 
  135                        $this->assertEquals($actual, $this->node);
 
  137                        $this->assertTrue(
false, 
'Context not identical.');
 
An exception for terminatinating execution or to throw for unit testing.
@noinspection PhpIncludeInspection
@noinspection PhpIncludeInspection
ilSimpleDetectorTest is part of the petri net based workflow engine.
testConstructorValidContext()
@noinspection PhpIncludeInspection