Example #1
0
 public function testOutputReadFileError()
 {
     $path = __FILE__;
     $this->output->expects($this->once())->method('getHttpResponseCode')->will($this->returnValue(Http::STATUS_OK));
     $this->output->expects($this->once())->method('setReadfile')->will($this->returnValue(false));
     $this->output->expects($this->once())->method('setHttpResponseCode')->with($this->equalTo(Http::STATUS_BAD_REQUEST));
     $response = new StreamResponse($path);
     $response->callback($this->output);
 }
 /**
  * download logfile
  *
  * @NoCSRFRequired
  *
  * @return StreamResponse
  */
 public function download()
 {
     $resp = new StreamResponse(\OC\Log\Owncloud::getLogFilePath());
     $resp->addHeader('Content-Type', 'application/octet-stream');
     $resp->addHeader('Content-Disposition', 'attachment; filename="owncloud.log"');
     return $resp;
 }