Skip to content
Snippets Groups Projects
Commit 60ecb2eb authored by Alex Arnaud's avatar Alex Arnaud
Browse files

dev #17871 OAI

Fix tests on negative
parent 8f8eb64f
Branches
Tags
2 merge requests!917Dev#17871 oaista la vista,!904Dev#17871 oaista la vista
......@@ -39,6 +39,12 @@ class Class_Cosmogramme_Integration_PhasePrepareIntegrations extends Class_Cosmo
throw new Class_Cosmogramme_Integration_PhasePrepareIntegrationsException('La variable integration_path n\'est pas définie');
}
protected function _previousPhaseIds() {
return [0];
}
public function _execute() {
$this->_log->ecrire('<table class="blank" cellspacing="0" cellpadding="5px">');
......@@ -68,15 +74,14 @@ class Class_Cosmogramme_Integration_PhasePrepareIntegrations extends Class_Cosmo
if (!$ftpfile || !$this->getFileSystem()->is_file($ftpfile)) {
$this->_log->ecrire("pas de transfert</td>");
$this->_log->ecrire("pas de transfert pour: $ftpfile</td>");
return $this;
}
if (!$this->_checkFileSize($ftpfile, $majauto))
return $this;
if (!$this->getFilesystem()->rename($ftpfile, $this->_integration_path.$newfile == true)) {
if (true !== $this->getFilesystem()->rename($ftpfile, $this->_integration_path.$newfile)) {
$this->_log->ecrire('<span class="rouge">erreur au transfert du fichier</span></td>');
$this->_incrementData('traitement_erreurs');
return $this;
......@@ -103,11 +108,11 @@ class Class_Cosmogramme_Integration_PhasePrepareIntegrations extends Class_Cosmo
$pos++;
$ftp_path .= substr($filename, 0, $pos);
$this->_ftp_path .= substr($filename, 0, $pos);
$filename =substr($filename, $pos);
}
if (!$dir = opendir($ftp_path)) {
if (!$dir = opendir($this->_ftp_path)) {
$this->_log->ecrire('<span class="rouge">répertoire inaccessible: '.$this->_ftp_path.'</span>');
$this->_incrementData('traitement_erreurs');
return null;
......@@ -117,7 +122,7 @@ class Class_Cosmogramme_Integration_PhasePrepareIntegrations extends Class_Cosmo
if(strpos($file, $filename) === false)
continue;
$ret = $ftp_path.$file;
$ret = $this->_ftp_path.$file;
break;
}
closedir($dir);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment