Author: sb
Date: Tue Jul 31 09:43:10 2007
New Revision: 5762

Log:
- Add test.
# 100% code coverage for ezcWorkflowNodeSubWorkflow now.

Modified:
    trunk/Workflow/tests/execution_test.php

Modified: trunk/Workflow/tests/execution_test.php
==============================================================================
--- trunk/Workflow/tests/execution_test.php [iso-8859-1] (original)
+++ trunk/Workflow/tests/execution_test.php [iso-8859-1] Tue Jul 31 09:43:10 
2007
@@ -27,7 +27,6 @@
     {
         parent::setUp();
         $this->execution = new ezcWorkflowTestExecution;
-        $this->execution->definitionStorage = $this->definition;
     }
 
     public function testNoWorkflowRaisesException()
@@ -435,19 +434,42 @@
     public function testNonInteractiveSubWorkflow()
     {
         $this->setUpWorkflowWithSubWorkflow( 'StartEnd' );
-        $this->workflow->definitionStorage = $this->definition;
-        $this->execution->workflow = $this->workflow;
-        $this->execution->start();
-
-        $this->assertTrue( $this->execution->hasEnded() );
-        $this->assertFalse( $this->execution->isResumed() );
-        $this->assertFalse( $this->execution->isSuspended() );
+        $this->execution->definitionStorage = $this->definition;
+        $this->execution->workflow = $this->workflow;
+        $this->execution->start();
+
+        $this->assertTrue( $this->execution->hasEnded() );
+        $this->assertFalse( $this->execution->isResumed() );
+        $this->assertFalse( $this->execution->isSuspended() );
+    }
+
+    public function testNonInteractiveSubWorkflow2()
+    {
+        $this->setUpWorkflowWithSubWorkflow( 'StartEnd' );
+        $this->execution->workflow = $this->workflow;
+
+        try
+        {
+            $this->execution->start();
+        }
+
+        catch ( ezcWorkflowExecutionException $e )
+        {
+            $this->assertEquals(
+              'No ezcWorkflowDefinitionStorage implementation available.',
+              $e->getMessage()
+            ); 
+
+            return;
+        }
+
+        $this->fail();
     }
 
     public function testInteractiveSubWorkflow()
     {
         $this->setUpWorkflowWithSubWorkflow( 'StartInputEnd' );
-        $this->workflow->definitionStorage = $this->definition;
+        $this->execution->definitionStorage = $this->definition;
         $this->execution->workflow = $this->workflow;
         $this->execution->setInputVariableForSubWorkflow( 'variable', 'value' 
);
         $this->execution->start();


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

Reply via email to