diff --git a/workflow/engine/src/BusinessModel/Department.php b/workflow/engine/src/BusinessModel/Department.php index c48367f0f..e611aecd1 100644 --- a/workflow/engine/src/BusinessModel/Department.php +++ b/workflow/engine/src/BusinessModel/Department.php @@ -151,7 +151,7 @@ class Department $dep_uid = Validator::depUid($dep_uid); $dep_data = $this->getDepartment($dep_uid); if ($dep_data['has_children'] != 0) { - throw (new \Exception("Can not delete the department. The department has children")); + throw (new \Exception("Can not delete the department, it has a children department.")); } $oDepartment = new \Department(); $oDepartment->remove($dep_uid); diff --git a/workflow/engine/src/BusinessModel/Process.php b/workflow/engine/src/BusinessModel/Process.php index 428762903..fcae7d07a 100644 --- a/workflow/engine/src/BusinessModel/Process.php +++ b/workflow/engine/src/BusinessModel/Process.php @@ -238,7 +238,7 @@ class Process switch ($arrayFieldDefinition[$fieldName]["type"]) { case "array": if (!is_array($fieldValue)) { - if (!preg_match("/^\s*array\s*\(.*\)\s*$/", $fieldValue)) { + if ((!preg_match("/^\s*array\s*\(.*\)\s*$/", $fieldValue)) && $fieldValue != '') { throw (new \Exception(str_replace(array("{0}"), array($fieldNameAux), "The \"{0}\" attribute is not array"))); } } diff --git a/workflow/engine/src/BusinessModel/Validator.php b/workflow/engine/src/BusinessModel/Validator.php index 0acde6aa5..0e81a0c68 100644 --- a/workflow/engine/src/BusinessModel/Validator.php +++ b/workflow/engine/src/BusinessModel/Validator.php @@ -70,7 +70,7 @@ class Validator{ $oDataset = \DepartmentPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC ); if ($oDataset->next()) { - throw (new \Exception("The departament with dep_title: '$dep_title' exist.")); + throw (new \Exception("The departament with dep_title: '$dep_title' already exists.")); } return $dep_title; } @@ -133,7 +133,7 @@ class Validator{ static public function isArray($field, $nameField) { if (!is_array($field)) { - throw (new \Exception("The field '$nameField' is not an array.")); + throw (new \Exception("Invalid value for '$nameField' it must be an array.")); } } @@ -150,7 +150,7 @@ class Validator{ static public function isBoolean($field, $nameField) { if (!is_bool($field)) { - throw (new \Exception("The field '$nameField' is not a boolean.")); + throw (new \Exception("Invalid value for '$nameField' it must be a boolean.")); } } diff --git a/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php b/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php index 588f677de..d926483d2 100644 --- a/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php +++ b/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php @@ -37,7 +37,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * * @covers \BusinessModel\Department::saveDepartment * @expectedException Exception - * @expectedExceptionMessage The field '$dep_data' is not an array. + * @expectedExceptionMessage Invalid value for '$dep_data' it must be an array. * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -52,7 +52,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * * @covers \BusinessModel\Department::saveDepartment * @expectedException Exception - * @expectedExceptionMessage The field '$create' is not a boolean. + * @expectedExceptionMessage Invalid value for '$create' it must be a boolean. * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -171,7 +171,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * @param array $dep_data, Data for parent department * @covers \BusinessModel\Department::saveDepartment * @expectedException Exception - * @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' exist. + * @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists. * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -237,7 +237,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * @param array $child_data, Data for child department * @covers \BusinessModel\Department::saveDepartment * @expectedException Exception - * @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' exist. + * @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists. * @return array * * @author Brayan Pereyra (Cochalo) @@ -321,7 +321,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * @param array $child_data, Data for child department * @covers \BusinessModel\Department::deleteDepartment * @expectedException Exception - * @expectedExceptionMessage Can not delete the department. The department has children + * @expectedExceptionMessage Can not delete the department, it has a children department. * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia