diff --git a/build.xml b/build.xml index 4d81eee93..f6478e432 100644 --- a/build.xml +++ b/build.xml @@ -123,7 +123,10 @@ - + + + + diff --git a/features/backend/application_cases/case_actions/main_tests_cases_actions.feature b/features/backend/application_cases/case_actions/main_tests_cases_actions.feature index cac5b2773..0efeb5ef9 100644 --- a/features/backend/application_cases/case_actions/main_tests_cases_actions.feature +++ b/features/backend/application_cases/case_actions/main_tests_cases_actions.feature @@ -48,21 +48,21 @@ Scenario: Returns a list of the cases for the logged in user (Paused) And the response has 12 records -Scenario: Returns information about a given case of the list Inbox - Given I request "cases/48177942153275bfa28bd04070312685" +Scenario: Returns information about a given case of the list Inbox of process "Derivation rules - Parallel" + Given I request "cases/220090038533b0c40688174019225585" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the "app_uid" property equals "48177942153275bfa28bd04070312685" - And the "app_number" property equals 16 - And the "app_name" property equals "#16" + And the "app_uid" property equals "220090038533b0c40688174019225585" + And the "app_number" property equals 137 + And the "app_name" property equals "#137" And the "app_status" property equals "TO_DO" And the "app_init_usr_uid" property equals "00000000000000000000000000000001" And the "app_init_usr_username" property equals "Administrator" - And the "pro_uid" property equals "99209594750ec27ea338927000421575" - And the "pro_name" property equals "Derivation rules - sequential" - And the "app_create_date" property equals "2014-03-17 16:32:58" - And the "app_update_date" property equals "2014-03-17 16:33:01" + And the "pro_uid" property equals "35894775350ec7daa099378048029617" + And the "pro_name" property equals "Derivation rules - Parallel" + And the "app_create_date" property equals "2014-04-01 14:58:08" + And the "app_update_date" property equals "2014-04-01 14:58:20" Scenario: Returns the current task for a given case of the list Inbox diff --git a/features/backend/projects/process_permissions/basic_sequence_permissions.feature b/features/backend/projects/process_permissions/basic_sequence_permissions.feature index 9d772d2ac..448910dcf 100644 --- a/features/backend/projects/process_permissions/basic_sequence_permissions.feature +++ b/features/backend/projects/process_permissions/basic_sequence_permissions.feature @@ -1,4 +1,4 @@ -miche@ProcessMakerMichelangelo @RestAPI +@ProcessMakerMichelangelo @RestAPI Feature: ProcessPermissions Resources @1: TEST FOR GET PROCESS PERMISSIONS /---------------------------------------------------------------------- diff --git a/framework/src/Maveriks/Extension/Restler.php b/framework/src/Maveriks/Extension/Restler.php index e4f043839..c60c3d163 100644 --- a/framework/src/Maveriks/Extension/Restler.php +++ b/framework/src/Maveriks/Extension/Restler.php @@ -3,6 +3,9 @@ namespace Maveriks\Extension; use Luracast\Restler\Defaults; use Luracast\Restler\Format\UrlEncodedFormat; +use ProcessMaker\Services\Api; +use Luracast\Restler\RestException; + /** * Class Restler * Extension Restler class to implement in ProcessMaker @@ -103,4 +106,20 @@ class Restler extends \Luracast\Restler\Restler } return $includeQueryParameters ? $get : array(); //no body } + + /** + * This method call the function message + * + * @param RestException $e. Exception the error + * + * @access public + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @return void + */ + public function setMessage(RestException $e) + { + $this->message($e); + } } \ No newline at end of file diff --git a/framework/src/Maveriks/WebApplication.php b/framework/src/Maveriks/WebApplication.php index 8d645659f..edc86752e 100644 --- a/framework/src/Maveriks/WebApplication.php +++ b/framework/src/Maveriks/WebApplication.php @@ -3,6 +3,8 @@ namespace Maveriks; use Maveriks\Util; use ProcessMaker\Services; +use ProcessMaker\Services\Api; +use Luracast\Restler\RestException; class WebApplication { @@ -106,10 +108,19 @@ class WebApplication public function multipart($uri, $version = "1.0") { $stringInput = file_get_contents('php://input'); - if (is_null($stringInput)) { - return array(); //no body + if (empty($stringInput)) { + $rest = new \Maveriks\Extension\Restler(); + $rest->setMessage(new RestException(Api::STAT_APP_EXCEPTION, "Invalid Request, multipart without body.")); + exit(); + } else { + $input = json_decode($stringInput); + if (empty($input->calls)) { + $rest = new \Maveriks\Extension\Restler(); + $rest->setMessage(new RestException(Api::STAT_APP_EXCEPTION, "Invalid Request, multipart body without calls.")); + exit(); + } } - $input = json_decode($stringInput); + $baseUrl = (empty($input->base_url)) ? $uri : $input->base_url; foreach($input->calls as $value) { diff --git a/phpunit.xml b/phpunit.xml index d3ed5e4d7..fe75d4cad 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@ ./tests/unit/ --> + + ./workflow/engine/src/ +