diff --git a/tests/src/Actions/Imports/Http/Controllers/DownloadImportFailureCsvTest.php b/tests/src/Actions/Imports/Http/Controllers/DownloadImportFailureCsvTest.php index a52055f33f..8db530e472 100644 --- a/tests/src/Actions/Imports/Http/Controllers/DownloadImportFailureCsvTest.php +++ b/tests/src/Actions/Imports/Http/Controllers/DownloadImportFailureCsvTest.php @@ -1,5 +1,6 @@ importer` (e.g. for the +// `shouldPreventFormulaInjection()` static call) instead of a non-existent class string. +class DownloadFailureTestImporter extends Importer +{ + public static function getColumns(): array + { + return []; + } + + public static function getCompletedNotificationBody(Import $import): string + { + return ''; + } +} + // Policy that grants `view` access to any user, so that a non-owner can download. class AllowImportViewPolicy { @@ -33,7 +49,7 @@ function createImportForOwner(User $owner): Import return Import::create([ 'file_name' => 'import.csv', 'file_path' => 'imports/import.csv', - 'importer' => 'App\\Filament\\Imports\\TestImporter', + 'importer' => DownloadFailureTestImporter::class, 'total_rows' => 1, 'successful_rows' => 0, 'user_id' => $owner->getKey(), diff --git a/tests/src/Actions/Imports/ImporterTest.php b/tests/src/Actions/Imports/ImporterTest.php index 37524c712e..697972472b 100644 --- a/tests/src/Actions/Imports/ImporterTest.php +++ b/tests/src/Actions/Imports/ImporterTest.php @@ -59,13 +59,6 @@ describe('`shouldPreventFormulaInjection()`', function (): void { }); describe('failure CSV formula injection', function (): void { - beforeEach(function (): void { - $migrations = dirname(__DIR__, 4) . '/packages/actions/database/migrations'; - - (include "{$migrations}/create_imports_table.php")->up(); - (include "{$migrations}/create_failed_import_rows_table.php")->up(); - }); - $downloadFailureCsv = function (string $importer): string { $user = User::factory()->create(); $this->actingAs($user);