Author: Sebastian Bergmann
Date: 2007-01-16 10:51:48 +0100 (Tue, 16 Jan 2007)
New Revision: 4513

Log:
- Simplify Mock Object handling.
Modified:
   experimental/Workflow/tests/case.php

Modified: experimental/Workflow/tests/case.php
===================================================================
--- experimental/Workflow/tests/case.php        2007-01-16 09:41:36 UTC (rev 
4512)
+++ experimental/Workflow/tests/case.php        2007-01-16 09:51:48 UTC (rev 
4513)
@@ -15,6 +15,10 @@
  */
 abstract class ezcWorkflowTestCase extends ezcTestCase
 {
+    protected static $aMock = null;
+    protected static $bMock = null;
+    protected static $cMock = null;
+
     protected $definition;
     protected $workflow;
     protected $startNode;
@@ -27,9 +31,17 @@
     protected function setUp()
     {
         parent::setUp();
+
         $this->definition = new ezcWorkflowDefinitionXml(
           dirname( __FILE__ ) . '/data/'
         );
+
+        if ( self::$aMock === null )
+        {
+            self::$aMock = $this->getMock( 'ezcWorkflowServiceObject', 
array(), array(), 'SOA' );
+            self::$bMock = $this->getMock( 'ezcWorkflowServiceObject', 
array(), array(), 'SOB' );
+            self::$cMock = $this->getMock( 'ezcWorkflowServiceObject', 
array(), array(), 'SOC' );
+        }
     }
 
     protected function setUpEmptyWorkflow()
@@ -161,10 +173,6 @@
 
         $this->branchNode = new ezcWorkflowNodeParallelSplit;
 
-        $aMock = $this->getMock( 'ezcWorkflowServiceObject', array(), array(), 
'SOA' );
-        $bMock = $this->getMock( 'ezcWorkflowServiceObject', array(), array(), 
'SOB' );
-        $cMock = $this->getMock( 'ezcWorkflowServiceObject', array(), array(), 
'SOC' );
-
         $this->actionNodeA = new ezcWorkflowNodeAction( 'SOA' );
         $this->actionNodeB = new ezcWorkflowNodeAction( 'SOB' );
         $this->actionNodeC = new ezcWorkflowNodeAction( 'SOC' );
@@ -190,9 +198,6 @@
 
         $this->branchNode = new ezcWorkflowNodeExclusiveChoice;
 
-        $aMock = $this->getMock( 'ezcWorkflowServiceObject', array(), array(), 
'SOA' );
-        $bMock = $this->getMock( 'ezcWorkflowServiceObject', array(), array(), 
'SOB' );
-
         $this->actionNodeA = new ezcWorkflowNodeAction( 'SOA' );
         $this->actionNodeB = new ezcWorkflowNodeAction( 'SOB' );
 

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

Reply via email to