Author: sb
Date: Mon Feb 18 10:17:24 2008
New Revision: 7397

Log:
- Add tests.

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] Mon Feb 18 10:17:24 
2008
@@ -186,6 +186,26 @@
         $this->assertTrue( $this->execution->hasEnded() );
         $this->assertFalse( $this->execution->isResumed() );
         $this->assertFalse( $this->execution->isSuspended() );
+        $this->assertFalse( $this->execution->hasVariable( 'x' ) );
+    }
+
+    public function testExecuteStartSetUnsetEnd2()
+    {
+        $plugin = $this->getMock( 'ezcWorkflowExecutionPlugin', array( 
'beforeVariableUnset' ) );
+        $plugin->expects( $this->any() )
+               ->method( 'beforeVariableUnset' )
+               ->will( $this->returnValue( false ) );
+
+        $this->setUpStartSetUnsetEnd();
+        $this->execution->workflow = $this->workflow;
+        $this->execution->addPlugin( $plugin );
+        $this->execution->start();
+
+        $this->assertFalse( $this->execution->isCancelled() );
+        $this->assertTrue( $this->execution->hasEnded() );
+        $this->assertFalse( $this->execution->isResumed() );
+        $this->assertFalse( $this->execution->isSuspended() );
+        $this->assertTrue( $this->execution->hasVariable( 'x' ) );
     }
 
     public function testExecuteIncrementingLoop()
@@ -690,6 +710,8 @@
     {
         $listener = $this->getMock( 'ezcWorkflowExecutionListener' );
 
+        $this->assertFalse( $this->execution->removeListener( $listener ) );
+
         $this->assertTrue( $this->execution->addListener( $listener ) );
         $this->assertFalse( $this->execution->addListener( $listener ) );
 


-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to