Author: sb
Date: Tue Jul 31 09:53:57 2007
New Revision: 5763
Log:
- Add test.
# 100% code coverage for ezcWorkflowNodeAction.
Added:
trunk/Workflow/tests/data/ServiceObjectThatDoesNotFinish_1.xml
trunk/Workflow/tests/service_object_that_does_not_finish.php
- copied, changed from r5762,
trunk/Workflow/tests/service_object_with_constructor.php
Modified:
trunk/Workflow/tests/case.php
trunk/Workflow/tests/execution_test.php
Modified: trunk/Workflow/tests/case.php
==============================================================================
--- trunk/Workflow/tests/case.php [iso-8859-1] (original)
+++ trunk/Workflow/tests/case.php [iso-8859-1] Tue Jul 31 09:53:57 2007
@@ -7,6 +7,7 @@
* @license http://ez.no/licenses/new_bsd New BSD License
*/
+require_once 'service_object_that_does_not_finish.php';
require_once 'service_object_with_constructor.php';
require_once 'variable_handler.php';
Added: trunk/Workflow/tests/data/ServiceObjectThatDoesNotFinish_1.xml
==============================================================================
--- trunk/Workflow/tests/data/ServiceObjectThatDoesNotFinish_1.xml (added)
+++ trunk/Workflow/tests/data/ServiceObjectThatDoesNotFinish_1.xml [iso-8859-1]
Tue Jul 31 09:53:57 2007
@@ -1,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow name="ServiceObjectThatDoesNotFinish" version="1">
+ <node id="1" type="Start">
+ <outNode id="2"/>
+ </node>
+ <node id="2" type="Action"
serviceObjectClass="ServiceObjectThatDoesNotFinish">
+ <outNode id="3"/>
+ </node>
+ <node id="3" type="End"/>
+</workflow>
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:53:57
2007
@@ -452,7 +452,6 @@
{
$this->execution->start();
}
-
catch ( ezcWorkflowExecutionException $e )
{
$this->assertEquals(
@@ -490,6 +489,28 @@
$this->assertFalse( $this->execution->isSuspended() );
}
+ public function testServiceObjectThatDoesNotFinish()
+ {
+ $this->workflow = $this->definition->loadByName(
'ServiceObjectThatDoesNotFinish' );
+ $this->execution->workflow = $this->workflow;
+
+ try
+ {
+ $this->execution->start();
+ }
+ catch( ezcWorkflowExecutionException $e )
+ {
+ $this->assertEquals(
+ 'Workflow is waiting for input data that has not been mocked.',
+ $e->getMessage()
+ );
+
+ return;
+ }
+
+ $this->fail();
+ }
+
public function testGetVariable()
{
$this->setUpStartEnd();
Copied: trunk/Workflow/tests/service_object_that_does_not_finish.php (from
r5762, trunk/Workflow/tests/service_object_with_constructor.php)
==============================================================================
--- trunk/Workflow/tests/service_object_with_constructor.php [iso-8859-1]
(original)
+++ trunk/Workflow/tests/service_object_that_does_not_finish.php [iso-8859-1]
Tue Jul 31 09:53:57 2007
@@ -1,6 +1,6 @@
<?php
/**
- * File containing the ServiceObjectWithConstructor class.
+ * File containing the ServiceObjectThatDoesNotFinish class.
*
* @package Workflow
* @version //autogen//
@@ -9,21 +9,14 @@
*/
/**
- * A service object that has a constructor.
+ * A service object that does not finish.
*
* @package Workflow
* @subpackage Tests
* @version //autogen//
*/
-class ServiceObjectWithConstructor implements ezcWorkflowServiceObject
+class ServiceObjectThatDoesNotFinish implements ezcWorkflowServiceObject
{
- /**
- * Constructor.
- */
- public function __construct()
- {
- }
-
/**
* Executes the business logic of this service object.
*
@@ -32,7 +25,7 @@
*/
public function execute( ezcWorkflowExecution $execution )
{
- return true;
+ return false;
}
/**
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components