Cover the recent fixes with tests #279

Merged
pxlrbt merged 1 commit from tests/recent-fixes into main 2026-08-15 12:18:27 +00:00
pxlrbt commented 2026-08-15 12:17:23 +00:00 (Migrated from github.com)

Adds regression tests for the fixes merged over the last few PRs, which all went in untested.

File Covers
tests/PruneExportsTest.php #274 — prunes exports older than a day, keeps fresh ones, recurses into subdirectories
tests/DownloadExportTest.php #277 — streams from the disk under the original filename, deletes after send, 404s on a missing export, rejects unsigned links
tests/ExportDiskTest.php #277 — local default, and an app-configured filament-excel disk survives boot
tests/ExportFinishedTest.php #277 / #271 — the finished export is parked in the cache per user, with a string id, and skipped when there is no user

#278 is already covered by TableColumnsTest, #275 by the provider list in TestCase.

I checked the prune and disk tests against the pre-fix code and they do fail there, so they are real regression tests.

Fix needed to make the suite runnable

The suite was red on main: every test failed with Target class [filament] does not exist. bootingPackage() guarded Filament::serving() with class_exists(Filament::class), but the facade class being autoloadable does not mean the filament binding is registered — which is exactly what TestCase sets up (tables-only providers, panel package present in vendor). Switched to app()->bound('filament'), the same guard FilamentExport::sendDatabaseNotificationForPanel() already uses.

tests/TestCase.php also needed an array cache store and an app.key, since the download route runs through the web and signed middleware.

🤖 Generated with Claude Code

Adds regression tests for the fixes merged over the last few PRs, which all went in untested. | File | Covers | |---|---| | `tests/PruneExportsTest.php` | #274 — prunes exports older than a day, keeps fresh ones, recurses into subdirectories | | `tests/DownloadExportTest.php` | #277 — streams from the disk under the original filename, deletes after send, 404s on a missing export, rejects unsigned links | | `tests/ExportDiskTest.php` | #277 — local default, and an app-configured `filament-excel` disk survives boot | | `tests/ExportFinishedTest.php` | #277 / #271 — the finished export is parked in the cache per user, with a string id, and skipped when there is no user | #278 is already covered by `TableColumnsTest`, #275 by the provider list in `TestCase`. I checked the prune and disk tests against the pre-fix code and they do fail there, so they are real regression tests. ## Fix needed to make the suite runnable The suite was red on `main`: every test failed with `Target class [filament] does not exist`. `bootingPackage()` guarded `Filament::serving()` with `class_exists(Filament::class)`, but the facade class being autoloadable does not mean the `filament` binding is registered — which is exactly what `TestCase` sets up (tables-only providers, panel package present in vendor). Switched to `app()->bound('filament')`, the same guard `FilamentExport::sendDatabaseNotificationForPanel()` already uses. `tests/TestCase.php` also needed an array cache store and an `app.key`, since the download route runs through the `web` and `signed` middleware. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.