Merged in cochalo/processmaker (pull request #295)
Correccion de label en Phpunit DEPARTMENTS
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) <brayan@colosa.com>
|
||||
* @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) <brayan@colosa.com>
|
||||
* @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) <brayan@colosa.com>
|
||||
* @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) <brayan@colosa.com>
|
||||
@@ -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) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
|
||||
Reference in New Issue
Block a user