Cambio de path /tmp en los behat que obtienen un archivo
This commit is contained in:
@@ -1362,6 +1362,7 @@ class RestContext extends BehatContext
|
||||
*/
|
||||
public function postIWantToUploadTheFileToPathPublicUrl($prfFile, $prfPath, $url)
|
||||
{
|
||||
$prfFile = sys_get_temp_dir() . $prfFile;
|
||||
$baseUrl = $this->getParameter('base_url');
|
||||
$url = $baseUrl.$url;
|
||||
$accesstoken = $this->getParameter('access_token');
|
||||
@@ -1421,6 +1422,7 @@ class RestContext extends BehatContext
|
||||
*/
|
||||
public function postIWantToUploadTheImageToUser($imageFile, $usrUid, $url)
|
||||
{
|
||||
$imageFile = sys_get_temp_dir() . $imageFile;
|
||||
$baseUrl = $this->getParameter('base_url');
|
||||
$url = $baseUrl.$url.$usrUid."/image-upload";
|
||||
|
||||
@@ -1462,6 +1464,7 @@ class RestContext extends BehatContext
|
||||
}
|
||||
|
||||
$usrUid = $varValue;
|
||||
$imageFile = sys_get_temp_dir() . $imageFile;
|
||||
|
||||
$this->postIWantToUploadTheImageToUser($imageFile, $usrUid, $url);
|
||||
}
|
||||
@@ -1518,6 +1521,7 @@ class RestContext extends BehatContext
|
||||
*/
|
||||
public function postUploadAnInputDocumentTo($file, $url, PyStringNode $string)
|
||||
{
|
||||
$file = sys_get_temp_dir() . $file;
|
||||
$postFields = json_decode($string);
|
||||
$postFields->form ='@'.$file;
|
||||
|
||||
@@ -1533,6 +1537,7 @@ class RestContext extends BehatContext
|
||||
*/
|
||||
public function postUploadAProjectFile($file, $url)
|
||||
{
|
||||
$file = sys_get_temp_dir() . $file;
|
||||
$postFields = new StdClass();
|
||||
$postFields->project_file ='@'.$file;
|
||||
|
||||
@@ -1637,7 +1642,7 @@ class RestContext extends BehatContext
|
||||
|
||||
|
||||
}
|
||||
|
||||
$destinationFolder = sys_get_temp_dir() . $destinationFolder;
|
||||
$exportedProcessFileName = $destinationFolder.str_replace(" ","_",$exportedProcessFileName).".pmx";
|
||||
|
||||
$this->printDebug("Exporting process to: $exportedProcessFileName");
|
||||
@@ -1646,6 +1651,50 @@ class RestContext extends BehatContext
|
||||
chmod($exportedProcessFileName, 0777);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Given /^POST a dynaform:$/
|
||||
*/
|
||||
public function postADynaform(PyStringNode $string)
|
||||
{
|
||||
$postFields = json_decode($string);
|
||||
|
||||
if ((isset($postFields->dyn_content))&&(file_exists(sys_get_temp_dir() . $postFields->dyn_content))) {
|
||||
$postFields->dyn_content = sys_get_temp_dir() . $postFields->dyn_content;
|
||||
$this->printDebug("Extracting dyanform content from: ".$postFields->dyn_content."\n");
|
||||
$postFields->dyn_content = file_get_contents($postFields->dyn_content);
|
||||
|
||||
$string = json_encode($postFields);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->_restObjectMethod = 'post';
|
||||
$this->_headers['Content-Type'] = 'application/json; charset=UTF-8';
|
||||
$this->_requestBody = $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^PUT a dynaform:$/
|
||||
*/
|
||||
public function putADynaform(PyStringNode $string)
|
||||
{
|
||||
$postFields = json_decode($string);
|
||||
|
||||
if ((isset($postFields->dyn_content))&&(file_exists(sys_get_temp_dir() . $postFields->dyn_content))) {
|
||||
$postFields->dyn_content = sys_get_temp_dir() . $postFields->dyn_content;
|
||||
$this->printDebug("Extracting dyanform content from: ".$postFields->dyn_content."\n");
|
||||
$postFields->dyn_content = file_get_contents($postFields->dyn_content);
|
||||
|
||||
$string = json_encode($postFields);
|
||||
}
|
||||
|
||||
|
||||
$this->_restObjectMethod = 'put';
|
||||
$this->_headers['Content-Type'] = 'application/json; charset=UTF-8';
|
||||
$this->_requestBody = $string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user