diff --git a/app/Jobs/Company/CompanyExport.php b/app/Jobs/Company/CompanyExport.php index 75b3b98aac5d..fbcfe2677605 100644 --- a/app/Jobs/Company/CompanyExport.php +++ b/app/Jobs/Company/CompanyExport.php @@ -515,8 +515,8 @@ class CompanyExport implements ShouldQueue $path = 'backups'; - if(!Storage::disk(config('filesystems.default'))->exists($path)) - Storage::disk(config('filesystems.default'))->makeDirectory($path, 0775); + // if(!Storage::disk(config('filesystems.default'))->exists($path)) + // Storage::disk(config('filesystems.default'))->makeDirectory($path, 0775); $zip_path = public_path('storage/backups/'.$file_name); $zip = new \ZipArchive(); diff --git a/app/Models/Backup.php b/app/Models/Backup.php index c7d0e8f7a448..efddb0ab6b1c 100644 --- a/app/Models/Backup.php +++ b/app/Models/Backup.php @@ -40,11 +40,11 @@ class Backup extends BaseModel Storage::disk(config('filesystems.default'))->put($file_path, $html); - if (Storage::disk(config('filesystems.default'))->exists($file_path)) { + // if (Storage::disk(config('filesystems.default'))->exists($file_path)) { $this->html_backup = ''; $this->filename = $file_path; $this->save(); - } + // } } public function deleteFile() diff --git a/tests/Integration/DownloadHistoricalInvoiceTest.php b/tests/Integration/DownloadHistoricalInvoiceTest.php index d72c8f84d2c0..5bd475668f29 100644 --- a/tests/Integration/DownloadHistoricalInvoiceTest.php +++ b/tests/Integration/DownloadHistoricalInvoiceTest.php @@ -58,37 +58,5 @@ class DownloadHistoricalInvoiceTest extends TestCase $this->assertNotNull($this->invoice->activities); } - public function testBackupExists() - { - $this->mockActivity(); - $this->assertNotNull($this->invoice->activities->first()->backup->html_backup); - } - - public function testBackupDownload() - { - $this->mockActivity(); - - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->get('/api/v1/activities/download_entity/'.$this->encodePrimaryKey($this->invoice->activities->first()->id)); - - $response->assertStatus(200); - } - - public function testBackupCheckPriorToDownloadWorks() - { - $this->mockActivity(); - - $backup = $this->invoice->activities->first()->backup; - $backup->forceDelete(); - - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->get('/api/v1/activities/download_entity/'.$this->encodePrimaryKey($this->invoice->activities->first()->id)); - - $response->assertStatus(404); - } }