Culminacion del behat para export/import proyect y nueva funcion para en rest para guardar el proyecto exportado
This commit is contained in:
@@ -1623,4 +1623,29 @@ class RestContext extends BehatContext
|
||||
throw new \Exception("JSON Response does not have '$varName' property\n\n" );
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Given /^save exported process to "([^"]*)"$/
|
||||
* @Given /^save exported process to "([^"]*)" as "([^"]*)"$/
|
||||
*/
|
||||
public function saveExportedProcessTo($destinationFolder, $exportedProcessFileName="")
|
||||
{
|
||||
|
||||
if($exportedProcessFileName == ""){//Obtain name from XML
|
||||
$exportedProcessFileName=$this->_data->xpath('//metadata/meta[@key="name"]');
|
||||
$exportedProcessFileName = $exportedProcessFileName[0];
|
||||
$exportedProcessFileName = "ExpBehat ".$exportedProcessFileName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
$exportedProcessFileName = $destinationFolder.str_replace(" ","_",$exportedProcessFileName).".pmx";
|
||||
|
||||
$this->printDebug("Exporting process to: $exportedProcessFileName");
|
||||
|
||||
file_put_contents($exportedProcessFileName, $this->_response->getBody(true));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user