Hallo!
Ich beschäftige mich seit ca 4 Wochen mit CakePHP. Meine Frage betrifft das Testen einer Methode im Controller.
Die Methode im Controller sieht folgendermaßen aus:
function download($id) {
$file = $this->CollectedFile->findById($id);
$target_system = $this->FileTransfer->findById($id);
$location_id = $target_system['FileTransfer']['location_id'];
$location_name = $this->UserLocation->findById($location_id);
$this->view = 'Media';
$ext = explode(".", $file['CollectedFile']['filename']);
$params = array(
'id' => $file['CollectedFile']['db_filename'],
'name' => $file['CollectedFile']['filename'],
'extension' => $ext[count($ext)-1],
'download' => true,
'path' => '/var/opt/intranect/serverxs/data/'.$location_name['UserLocation']['location'].'/spool/gss/'.$target_system['FileTransfer']['target_system'].'/out' . DS
);
$this->set($params);
}
Die Methode öffnet ein Popup-Fenster zum Öffnen/Herunterladen der Datei und hat keine View.
Nun möchte ich diese im TestController testen, hab leider keinen Ansatzt wie das funktionieren sollte. :-S
Hat jemand damit eine Erfahrung oder eine Idee?