Testing and roadmap
Testing and roadmap
Testing
Laracrate ships its own test suite (Testbench plus PHPUnit). It runs against a real MySQL database, because the package migrations use MySQL-specific features (FULLTEXT indexes, information_schema lookups, ALTER ... MODIFY) that SQLite cannot run. Object storage is never touched: the AWS S3 client is mocked and the disks are backed by Storage::fake(), so the suite makes no external calls and needs no ffmpeg, imagick, or live S3.
You need PHP with the pdo_mysql extension and a MySQL (or MariaDB) server. Use a dedicated test database: the suite runs migrate:fresh, which drops every table in it.
1. Start a throwaway MySQL
The simplest option is a disposable container:
docker run -d --name laracrate-mysql \ -e MYSQL_ROOT_PASSWORD=root \ -e MYSQL_DATABASE=laracrate_test \ -p 3307:3306 mysql:8
2. Run the suite
composer install vendor/bin/phpunit
The test connection defaults to that container (127.0.0.1:3307, database laracrate_test, user root). Point it elsewhere with environment variables:
LARACRATE_TEST_DB_HOST=127.0.0.1 \ LARACRATE_TEST_DB_PORT=3307 \ LARACRATE_TEST_DB_DATABASE=laracrate_test \ LARACRATE_TEST_DB_USERNAME=root \ LARACRATE_TEST_DB_PASSWORD=root \ vendor/bin/phpunit
The schema is built once per run with migrate:fresh and each test is wrapped in a transaction, so a full run finishes in a few seconds. The PHPUnit config defines two suites, Unit (tests/Unit) and Feature (tests/Feature), keeps the AWS SDK offline, and sets APP_ENV=testing. Any feature you contribute should bring its own test under tests/.
When you are done, remove the container with docker rm -f laracrate-mysql.
Roadmap
The items below are planned or under consideration. They are distilled from the package backlog and may change. Nothing here is a commitment to ship.
- Deferred uploader Livewire component (
laracrate-deferred-uploader): select and preview a file, then commit to storage only on an explicit confirm, with a discard path. Useful for crop UIs, multi-step forms, and avoiding wasted uploads. - Library uploader Livewire component (
laracrate-library-uploader): multi-file collections with a default toggle, drag-and-drop reorder, and per-row delete, the pattern apps build by hand today. tileandbannerlayouts: a square compact layout with hover overlay controls, and a wide cover layout (16:9 or 21:9) for heroes and OG images, both across all uploader themes.- Sync processing in dev: an option to run the processing pipeline inline when there is no queue worker (or when
queue.defaultissync), so a freshly uploaded file is not stuck showing its unoptimized original. php artisan laracrate:doctor: an installation diagnostic that checks disks, backend connectivity, ffmpeg/ffprobe, Imagick/GD, the queue worker, and inconsistent rows.php artisan laracrate:purge-orphan-tmp: cleanup of orphaned temporary uploads left behind when an upload fails midway.- Docs site: a dedicated documentation site once the README outgrows a single file.
built and maintained by Edu Lazaro · MIT license