actingAsForApi(User::factory()->canImport()->create()); $this->importFileResponse(['import' => 9999, 'import-type' => 'accessory']) ->assertStatusMessageIs('import-errors'); } #[Test] public function processing_another_users_import_does_not_overwrite_created_by(): void { $originalOwner = User::factory()->superuser()->create(); $otherUser = User::factory()->superuser()->create(); $import = Import::factory()->users()->create([ 'file_path' => UsersImportFileBuilder::new()->saveToImportsDirectory(), 'created_by' => $originalOwner->id, ]); $this->actingAsForApi($otherUser); $this->importFileResponse(['import' => $import->id, 'import-type' => 'user'])->assertOk(); $this->assertEquals($originalOwner->id, $import->refresh()->created_by); } }