mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Fix tests
This commit is contained in:
@@ -17,6 +17,7 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Str;
|
||||
use Storage;
|
||||
|
||||
/**
|
||||
* Class ExportJobRepository
|
||||
@@ -94,6 +95,19 @@ class ExportJobRepository implements ExportJobRepositoryInterface
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ExportJob $job
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function exists(ExportJob $job): bool
|
||||
{
|
||||
$disk = Storage::disk('export');
|
||||
$file = $job->key . '.zip';
|
||||
|
||||
return $disk->exists($file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
*
|
||||
@@ -109,4 +123,17 @@ class ExportJobRepository implements ExportJobRepositoryInterface
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ExportJob $job
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContent(ExportJob $job): string
|
||||
{
|
||||
$disk = Storage::disk('export');
|
||||
$file = $job->key . '.zip';
|
||||
$content = $disk->get($file);
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,13 @@ interface ExportJobRepositoryInterface
|
||||
*/
|
||||
public function create(): ExportJob;
|
||||
|
||||
/**
|
||||
* @param ExportJob $job
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function exists(ExportJob $job): bool;
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
*
|
||||
@@ -39,4 +46,11 @@ interface ExportJobRepositoryInterface
|
||||
*/
|
||||
public function findByKey(string $key): ExportJob;
|
||||
|
||||
/**
|
||||
* @param ExportJob $job
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContent(ExportJob $job): string;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user