ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
 

Additional Inherited Members

- Protected Member Functions inherited from ilWorkflowEngineBaseTest
 setGlobalVariable ($name, $value)
 
 setUp ()
 

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 ( )

Reimplemented from ilWorkflowEngineBaseTest.

Definition at line 20 of file ilPluginNodeTest.php.

20 : void
21 {
23
24 // Empty workflow.
25 require_once './Services/WorkflowEngine/classes/workflows/class.ilEmptyWorkflow.php';
26 $this->workflow = new ilEmptyWorkflow();
27 }
@noinspection PhpIncludeInspection
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

◆ tearDown()

ilPluginNodeTest::tearDown ( )

Definition at line 29 of file ilPluginNodeTest.php.

29 : void
30 {
31 global $DIC;
32
33 if (isset($DIC['ilSetting'])) {
34 $DIC['ilSetting']->delete('IL_PHPUNIT_TEST_TIME');
35 $DIC['ilSetting']->delete('IL_PHPUNIT_TEST_MICROTIME');
36 }
37 }
$DIC
Definition: xapitoken.php:46

References $DIC.

◆ 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 }
@noinspection 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 }
@noinspection 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 }

◆ 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 }

Field Documentation

◆ $workflow

ilBaseWorkflow ilPluginNodeTest::$workflow

Definition at line 18 of file ilPluginNodeTest.php.


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