Merged in darojas/processmaker (pull request #223)
Se adiciona validacion para download en FILESMANAGER. Se mejora BEHAT para upload PMUSER y FILESMANAGER
This commit is contained in:
@@ -86,7 +86,7 @@ Feature: Files Manager Resources
|
||||
|
||||
#Para que funcione este test, debe existir el archivo que se quiere subir
|
||||
Scenario: Post files
|
||||
Given POST I want to upload the file "/home/daniel/test.txt" to path "public". Url to create prf_uid "http://daniel.pmos.colosa.net/api/1.0/daniel/project/1265557095225ff5c688f46031700471/file-manager" and updload "http://daniel.pmos.colosa.net/api/1.0/daniel/project/1265557095225ff5c688f46031700471/file-manager/upload"
|
||||
Given POST I want to upload the file "/home/daniel/test.txt" to path "public". Url to create prf_uid "project/1265557095225ff5c688f46031700471/file-manager" and updload "project/1265557095225ff5c688f46031700471/file-manager/upload"
|
||||
|
||||
Scenario: Delete file
|
||||
Given that I want to delete a "public/test.txt"
|
||||
|
||||
@@ -35,7 +35,7 @@ Feature: User
|
||||
#GET /api/1.0/{workspace}/user/{usr_uid}
|
||||
# Upload a image
|
||||
Scenario: Upload a image
|
||||
Given POST I want to upload the image "/home/daniel/pic2.jpg" to user "00000000000000000000000000000001". Url "http://daniel.pmos.colosa.net/api/1.0/daniel/user/"
|
||||
Given POST I want to upload the image "/home/daniel/pic3.jpg" to user "00000000000000000000000000000001". Url "user/"
|
||||
|
||||
#POST /api/1.0/{workspace}/user
|
||||
# Create new User
|
||||
|
||||
@@ -1318,6 +1318,9 @@ class RestContext extends BehatContext
|
||||
*/
|
||||
public function postIWantToUploadTheFileToPathPublicUrlToCreatePrfUidAndUpdload($prfFile, $prfPath, $postUrl, $url)
|
||||
{
|
||||
$baseUrl = $this->getParameter('base_url');
|
||||
$postUrl = $baseUrl.$postUrl;
|
||||
$url = $baseUrl.$url;
|
||||
$accesstoken = $this->getParameter('access_token');
|
||||
$headr = array();
|
||||
$headr[] = 'Authorization: Bearer '.$accesstoken;
|
||||
@@ -1350,7 +1353,8 @@ class RestContext extends BehatContext
|
||||
*/
|
||||
public function postIWantToUploadTheImageToUser($imageFile, $usrUid, $url)
|
||||
{
|
||||
$url = $url.$usrUid."/image-upload";
|
||||
$baseUrl = $this->getParameter('base_url');
|
||||
$url = $baseUrl.$url.$usrUid."/image-upload";
|
||||
$accesstoken = $this->getParameter('access_token');
|
||||
$headr = array();
|
||||
$headr[] = 'Authorization: Bearer '.$accesstoken;
|
||||
|
||||
@@ -421,8 +421,12 @@ class FilesManager
|
||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $sProcessUID . PATH_SEP . $sfile;
|
||||
break;
|
||||
}
|
||||
if (file_exists(PATH_SEP.$sDirectory)) {
|
||||
$oProcessMap = new \processMap(new \DBConnection());
|
||||
$oProcessMap->downloadFile($sProcessUID,$sMainDirectory,$sSubDirectory,$sfile);
|
||||
} else {
|
||||
throw (new \Exception( 'invalid value specified for `path`.'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user