incubator-zeta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebast...@apache.org
Subject [zeta-commits] svn commit: r978868 - in /incubator/zetacomponents/trunk/Workflow: src/definition_storage/xml.php tests/definition_xml_test.php
Date Sat, 24 Jul 2010 13:22:51 GMT
Author: sebastian
Date: Sat Jul 24 13:22:51 2010
New Revision: 978868

URL: http://svn.apache.org/viewvc?rev=978868&view=rev
Log:
Fix 16867.

Modified:
    incubator/zetacomponents/trunk/Workflow/src/definition_storage/xml.php
    incubator/zetacomponents/trunk/Workflow/tests/definition_xml_test.php

Modified: incubator/zetacomponents/trunk/Workflow/src/definition_storage/xml.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Workflow/src/definition_storage/xml.php?rev=978868&r1=978867&r2=978868&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Workflow/src/definition_storage/xml.php (original)
+++ incubator/zetacomponents/trunk/Workflow/src/definition_storage/xml.php Sat Jul 24 13:22:51
2010
@@ -192,8 +192,9 @@ class ezcWorkflowDefinitionStorageXml im
                         }
 
                         $condition = self::xmlToCondition( $childNode );
+                        $xpath     = new DOMXPath( $childNode->ownerDocument );
 
-                        foreach ( $childNode->getElementsByTagName( 'outNode' ) as $outNode
)
+                        foreach ($xpath->query( 'outNode', $childNode ) as $outNode)
                         {
                             if ( !isset( $elseId ) )
                             {

Modified: incubator/zetacomponents/trunk/Workflow/tests/definition_xml_test.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Workflow/tests/definition_xml_test.php?rev=978868&r1=978867&r2=978868&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Workflow/tests/definition_xml_test.php (original)
+++ incubator/zetacomponents/trunk/Workflow/tests/definition_xml_test.php Sat Jul 24 13:22:51
2010
@@ -197,6 +197,40 @@ class ezcWorkflowDefinitionStorageXmlTes
         $this->assertEquals( $expected, $actual );
     }
 
+    /**
+     * @ticket 16867
+     */
+    public function testIssue16867()
+    {
+        $workflow = new ezcWorkflow( 'Issue16867' );
+        $set      = new ezcWorkflowNodeVariableSet( array( 'path' => true ) );
+        $xor      = new ezcWorkflowNodeExclusiveChoice;
+        $dummy1   = new ezcWorkflowNodeVariableSet( array( 'dummy' => 1 ) );
+        $dummy2   = new ezcWorkflowNodeVariableSet( array( 'dummy' => 2 ) );
+        $merge    = new ezcWorkflowNodeSimpleMerge;
+        $workflow->startNode->addOutNode( $set );
+        $set->addOutNode( $xor );
+        $xor->addConditionalOutNode(
+          new ezcWorkflowConditionVariable(
+            'path',
+            new ezcWorkflowConditionIsTrue
+          ),
+          $dummy1,
+          $dummy2
+        );
+        $dummy1->addOutNode( $merge );
+        $dummy2->addOutNode( $merge );
+        $merge->addOutNode( $workflow->endNode );
+        $workflow->definitionStorage = $this->xmlStorage;
+
+        $this->assertEquals(
+          $workflow,
+          $this->xmlStorage->loadFromDocument(
+            $this->xmlStorage->saveToDocument( $workflow, 1 )
+          )
+        );
+    }
+
     protected function readActual( $name )
     {
         $actual = str_replace(



Mime
View raw message