diff --git a/src/BackupServiceProvider.php b/src/BackupServiceProvider.php index 3771b62c..92288ab2 100644 --- a/src/BackupServiceProvider.php +++ b/src/BackupServiceProvider.php @@ -50,7 +50,7 @@ public function packageRegistered(): void $this->app->singleton(ConsoleOutput::class); $this->app->bind(CleanupStrategy::class, config('backup.cleanup.strategy')); - $this->app->bind('backup-temporary-project', fn () => new TemporaryDirectory(config('backup.temporary_directory') ?? storage_path('app/backup-temp'))); + $this->app->bind('backup-temporary-project', fn () => new TemporaryDirectory(config('backup.backup.temporary_directory') ?? storage_path('app/backup-temp'))); $this->registerDiscordChannel(); diff --git a/tests/Config/ConfigTest.php b/tests/Config/ConfigTest.php index 8ebb3d92..d9b4f08b 100644 --- a/tests/Config/ConfigTest.php +++ b/tests/Config/ConfigTest.php @@ -27,3 +27,11 @@ expect($config->backup)->toBeInstanceOf(BackupConfig::class); expect($config->backup->name)->toBe('foo'); }); + +it('receives temp directory as configured from service container', function () { + config()->set('backup.backup.temporary_directory', '/foo'); + + $tempDirectory = app()->make('backup-temporary-project'); + + expect($tempDirectory->path())->toBe('/foo'); +});