ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPluginNodeTest Class Reference

ilPluginNodeTest is part of the petri net based workflow engine. More...

+ Inheritance diagram for ilPluginNodeTest:
+ Collaboration diagram for ilPluginNodeTest:

Public Member Functions

 setUp ()
 
 tearDown ()
 
 testConstructorValidContext ()
 
 testGetContext ()
 
 testIsActiveAndActivate ()
 
 testDeactivate ()
 

Data Fields

 $workflow
 

Detailed Description

ilPluginNodeTest is part of the petri net based workflow engine.

This class holds all tests for the class nodes/class.ilPluginNode.php

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

/

Definition at line 15 of file ilPluginNodeTest.php.

Member Function Documentation

◆ setUp()

ilPluginNodeTest::setUp ( )

Definition at line 20 of file ilPluginNodeTest.php.

21  {
22  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
23  //ilUnitUtil::performInitialisation();
24 
25  // Empty workflow.
26  require_once './Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
27  $this->workflow = new ilEmptyWorkflow();
28  }
PhpIncludeInspection

◆ tearDown()

ilPluginNodeTest::tearDown ( )

Definition at line 30 of file ilPluginNodeTest.php.

References $ilSetting.

31  {
32  global $ilSetting;
33  if ($ilSetting != null) {
34  $ilSetting->delete('IL_PHPUNIT_TEST_TIME');
35  $ilSetting->delete('IL_PHPUNIT_TEST_MICROTIME');
36  }
37  }
global $ilSetting
Definition: privfeed.php:17

◆ testConstructorValidContext()

ilPluginNodeTest::testConstructorValidContext ( )

Definition at line 39 of file ilPluginNodeTest.php.

40  {
41  // Act
42  $node = new ilPluginNode($this->workflow);
43 
44  // Assert
45  // No exception - good
46  $this->assertTrue(
47  true,
48  'Construction failed with valid context passed to constructor.'
49  );
50  }
PhpIncludeInspection

◆ testDeactivate()

ilPluginNodeTest::testDeactivate ( )

Definition at line 84 of file ilPluginNodeTest.php.

85  {
86  // Arrange
87  $node = new ilPluginNode($this->workflow);
88  require_once './Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
89  $detector = new ilSimpleDetector($node);
90  $node->addDetector($detector);
91 
92  // Act
93  $node->activate();
94 
95  // Assert
96  $this->assertTrue($node->isActive(), 'Node should be active but is inactive.');
97  $node->deactivate();
98  $this->assertFalse($node->isActive(), 'Node should be inactive but is active.');
99  }
PhpIncludeInspection
PhpIncludeInspection

◆ testGetContext()

ilPluginNodeTest::testGetContext ( )

Definition at line 52 of file ilPluginNodeTest.php.

53  {
54  // Arrange
55  $node = new ilPluginNode($this->workflow);
56 
57  // Act
58  $actual = $node->getContext();
59 
60  // Assert
61  if ($actual === $this->workflow) {
62  $this->assertEquals($actual, $this->workflow);
63  } else {
64  $this->assertTrue(false, 'Context not identical.');
65  }
66  }
PhpIncludeInspection

◆ testIsActiveAndActivate()

ilPluginNodeTest::testIsActiveAndActivate ( )

Definition at line 68 of file ilPluginNodeTest.php.

69  {
70  // Arrange
71  $node = new ilPluginNode($this->workflow);
72  require_once './Services/WorkflowEngine/classes/detectors/class.ilSimpleDetector.php';
73  $detector = new ilSimpleDetector($node);
74  $node->addDetector($detector);
75 
76  // Act
77  $node->activate();
78 
79  // Assert
80  $actual = $node->isActive();
81  $this->assertTrue($actual);
82  }
PhpIncludeInspection
PhpIncludeInspection

Field Documentation

◆ $workflow

ilPluginNodeTest::$workflow

Definition at line 18 of file ilPluginNodeTest.php.


The documentation for this class was generated from the following file: