Author: sb
Date: Fri Aug 10 10:58:32 2007
New Revision: 5864

Log:
- Add more tests.

Added:
    trunk/Workflow/tests/data/VariableEqualsVariable.dot   (with props)
Modified:
    trunk/Workflow/tests/condition_test.php
    trunk/Workflow/tests/visitor_visualization_test.php

Modified: trunk/Workflow/tests/condition_test.php
==============================================================================
--- trunk/Workflow/tests/condition_test.php [iso-8859-1] (original)
+++ trunk/Workflow/tests/condition_test.php [iso-8859-1] Fri Aug 10 10:58:32 
2007
@@ -202,6 +202,35 @@
         $this->assertFalse( $condition->evaluate( array( 'foo' => 'bar', 'bar' 
=> 'foo' ) ) );
     }
 
+    public function testVariables2()
+    {
+        try
+        {
+            $condition = new ezcWorkflowConditionVariables(
+              'foo',
+              'bar',
+              new ezcWorkflowConditionIsAnything
+            );
+        }
+        catch ( ezcWorkflowInvalidWorkflowException $e )
+        {
+            return;
+        }
+
+        $this->fail();
+    }
+
+    public function testVariables3()
+    {
+        $condition = new ezcWorkflowConditionVariables(
+          'foo',
+          'bar',
+          new ezcWorkflowConditionIsEqual
+        );
+
+        $this->assertFalse( $condition->evaluate( array() ) );
+    }
+
     public function testAnd()
     {
         $true = new ezcWorkflowConditionIsTrue;

Added: trunk/Workflow/tests/data/VariableEqualsVariable.dot
==============================================================================
--- trunk/Workflow/tests/data/VariableEqualsVariable.dot (added)
+++ trunk/Workflow/tests/data/VariableEqualsVariable.dot [iso-8859-1] Fri Aug 
10 10:58:32 2007
@@ -1,0 +1,17 @@
+digraph VariableEqualsVariable {
+node1 [label="Start"]
+node2 [label="a = 1, b = 1"]
+node3 [label="Exclusive Choice"]
+node4 [label="c = 1"]
+node5 [label="Simple Merge"]
+node6 [label="End"]
+node7 [label="c = 0"]
+
+node1 -> node2
+node2 -> node3
+node3 -> node4 [label="a == b"]
+node3 -> node7 [label="a != b"]
+node4 -> node5
+node5 -> node6
+node7 -> node5
+}

Propchange: trunk/Workflow/tests/data/VariableEqualsVariable.dot
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/Workflow/tests/visitor_visualization_test.php
==============================================================================
--- trunk/Workflow/tests/visitor_visualization_test.php [iso-8859-1] (original)
+++ trunk/Workflow/tests/visitor_visualization_test.php [iso-8859-1] Fri Aug 10 
10:58:32 2007
@@ -117,6 +117,17 @@
         );
     }
 
+    public function testVisitVariableEqualsVariable()
+    {
+        $this->setUpVariableEqualsVariable();
+        $this->workflow->accept( $this->visitor );
+
+        $this->assertEquals(
+          $this->readExpected( 'VariableEqualsVariable' ),
+          (string)$this->visitor
+        );
+    }
+
     public function testVisitParallelSplitSynchronization()
     {
         $this->setUpParallelSplitSynchronization();


-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to