diff --git a/app/Http/Controllers/V2/Exports/ExportAllProjectDataAsProjectDeveloperController.php b/app/Http/Controllers/V2/Exports/ExportAllProjectDataAsProjectDeveloperController.php index 8ad92f50e..31c65e9d8 100644 --- a/app/Http/Controllers/V2/Exports/ExportAllProjectDataAsProjectDeveloperController.php +++ b/app/Http/Controllers/V2/Exports/ExportAllProjectDataAsProjectDeveloperController.php @@ -35,7 +35,7 @@ public function __invoke(Request $request, Project $project) return (new DelayedJobResource($delayedJob))->additional(['message' => "Export for project $project->id is being processed"]); } else { - $filename = storage_path('./'.Str::of($project->name)->replace(['/', '\\'], '-') . ' full export - ' . now() . '.zip'); + $filename = storage_path('./'.Str::of($project->name)->replace(['/', '\\'], '-') . ' full export - ' . now()->format('d-m-Y') . '.zip'); file_put_contents($filename, $binary_data); return response()->download($filename)->deleteFileAfterSend(); diff --git a/app/Services/ExportAllProjectDataAsProjectDeveloperService.php b/app/Services/ExportAllProjectDataAsProjectDeveloperService.php index d3e1cc94f..19f20af45 100644 --- a/app/Services/ExportAllProjectDataAsProjectDeveloperService.php +++ b/app/Services/ExportAllProjectDataAsProjectDeveloperService.php @@ -17,7 +17,7 @@ class ExportAllProjectDataAsProjectDeveloperService { public function run($form, $project) { - $filename = storage_path('./'.Str::of($project->name)->replace(['/', '\\'], '-') . ' full export - ' . now() . '.zip'); + $filename = storage_path('./'.Str::of($project->name)->replace(['/', '\\'], '-') . ' full export - ' . now()->format('d-m-Y') . '.zip'); $zip = new \ZipArchive(); $zip->open($filename, \ZipArchive::CREATE); diff --git a/tests/V2/Exports/ExportEntitiesAsProjectDeveloperControllerTest.php b/tests/V2/Exports/ExportEntitiesAsProjectDeveloperControllerTest.php index 85a0e67ba..e95287493 100644 --- a/tests/V2/Exports/ExportEntitiesAsProjectDeveloperControllerTest.php +++ b/tests/V2/Exports/ExportEntitiesAsProjectDeveloperControllerTest.php @@ -238,7 +238,7 @@ public function test_an_user_can_export_all_project_data_gets_a_delayed_job_when */ public function test_an_user_can_export_all_project_data_when_already_cached(string $permission, string $fmKey) { - Carbon::setTestNow(now()); + Carbon::setTestNow(now()->format('d-m-Y')); $organisation = Organisation::factory()->create(); $owner = User::factory()->create(['organisation_id' => $organisation->id]); @@ -290,7 +290,7 @@ public function test_an_user_can_export_all_project_data_when_already_cached(str $this->actingAs($owner) ->get($uri) - ->assertDownload($project->name . ' full export - ' . now() . '.zip') + ->assertDownload($project->name . ' full export - ' . now()->format('d-m-Y') . '.zip') ->assertSuccessful(); }