Commit 64bd69aea555c4c02e21e290e336d8f6e6002dbb
1 parent
074951f0
Non-automated helper tests for workflow stuff.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3828 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
35 additions
and
0 deletions
tests/workflow/getByDocument.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once('../../config/dmsDefaults.php'); | ||
| 4 | + | ||
| 5 | +require_once(KT_LIB_DIR . '/documentmanagement/Document.inc'); | ||
| 6 | +require_once(KT_LIB_DIR . '/workflow/workflow.inc.php'); | ||
| 7 | +require_once(KT_LIB_DIR . '/workflow/workflowutil.inc.php'); | ||
| 8 | + | ||
| 9 | +$oDocument =& Document::get(4); | ||
| 10 | + | ||
| 11 | +$res = KTWorkflow::getByDocument($oDocument); | ||
| 12 | +if (PEAR::isError($res)) { | ||
| 13 | + print "FAILED\n"; | ||
| 14 | + var_dump($res); | ||
| 15 | +} | ||
| 16 | +$iWorkflowId = $res->getId(); | ||
| 17 | +if ($iWorkflowId != 1) { | ||
| 18 | + print "FAILED\n"; | ||
| 19 | + print $iWorkflowId; | ||
| 20 | +} |
tests/workflow/startWorkflowOnObject.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once('../../config/dmsDefaults.php'); | ||
| 4 | + | ||
| 5 | +require_once(KT_LIB_DIR . '/documentmanagement/Document.inc'); | ||
| 6 | +require_once(KT_LIB_DIR . '/workflow/workflow.inc.php'); | ||
| 7 | +require_once(KT_LIB_DIR . '/workflow/workflowutil.inc.php'); | ||
| 8 | + | ||
| 9 | +$oDocument =& Document::get(4); | ||
| 10 | +$oWorkflow =& KTWorkflow::get(1); | ||
| 11 | + | ||
| 12 | +$res = KTWorkflowUtil::startWorkflowOnDocument($oWorkflow, $oDocument); | ||
| 13 | +if (PEAR::isError($res)) { | ||
| 14 | + var_dump($res); | ||
| 15 | +} |