Se agregan unit test para OUTPUT DOCUMENTS, PROCESS CATEGORY, INPUTDOCUMENTS y se agregan validaciones para OUTPUT DOCUMENTS y PROCESS CATEGORY.

This commit is contained in:
Daniel Rojas
2014-04-07 16:25:36 -04:00
parent a5662a9ff1
commit 9f5a9910ba
5 changed files with 139 additions and 5 deletions

View File

@@ -56,6 +56,10 @@ class OutputDocument
public function getCasesOutputDocument($applicationUid, $userUid, $applicationDocumentUid)
{
try {
$oAppDocument = \AppDocumentPeer::retrieveByPK( $applicationDocumentUid, 1 );
if (is_null( $oAppDocument ) || $oAppDocument->getAppDocStatus() == 'DELETED') {
throw (new \Exception('This output document with id: '.$applicationDocumentUid.' doesn\'t exist!'));
}
$sApplicationUID = $applicationUid;
$sUserUID = $userUid;
\G::LoadClass('case');

View File

@@ -282,7 +282,10 @@ class ProcessCategory
public function addCategory($cat_name)
{
try {
require_once 'classes/model/ProcessCategory.php';
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes". PATH_SEP . "model" . PATH_SEP . "ProcessCategory.php");
if ($cat_name == '') {
throw (new \Exception( 'cat_name. Process Category name can\'t be null'));
}
$catName = trim( $cat_name );
if ($this->existsName( $cat_name )) {
throw (new \Exception( 'cat_name. Duplicate Process Category name'));
@@ -312,7 +315,7 @@ class ProcessCategory
public function updateCategory($cat_uid, $cat_name)
{
try {
require_once 'classes/model/ProcessCategory.php';
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes". PATH_SEP . "model" . PATH_SEP . "ProcessCategory.php");
$catUID = $cat_uid;
$catName = trim( $cat_name );
if ($this->existsName( $cat_name )) {