PatoLab’s automated test suite is built on Pest PHP (sitting on top of PHPUnit), and is designed to run with zero external infrastructure. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lerichardv/patolab-platform/llms.txt
Use this file to discover all available pages before exploring further.
phpunit.xml configuration points the test database at an in-memory SQLite instance, so every test run starts from a clean, isolated state without needing a running MySQL or PostgreSQL server. Code quality is enforced by Laravel Pint on the PHP side and ESLint + Prettier on the TypeScript/React side — all of which are wired into a single composer ci:check command that mirrors what runs in the CI pipeline.
Test Framework
| Tool | Role |
|---|---|
| Pest PHP v4 | Test runner and assertion API |
| PHPUnit | Underlying engine (Pest is a Pest-flavoured layer on top) |
| pest-plugin-laravel | Laravel-specific helpers (actingAs, assertDatabaseHas, etc.) |
Test Suites
PHPUnit is configured with two suites inphpunit.xml:
Existing test files
tests/Unit/
| File | What it tests |
|---|---|
ReportPaginatorTest.php | Unit behaviour of the report paginator utility |
tests/Feature/
| File | What it tests |
|---|---|
MicroscopyCommissionTest.php | Commission calculations for microscopy specimens |
MySpecimenTypeTemplateTest.php | User-scoped specimen type template retrieval |
SpecimenTypeTemplateTest.php | CRUD and access control for specimen type templates |
tests/Pest.php— global Pest configuration and dataset helperstests/TestCase.php— base test case (extends Laravel’sTestCase)
Test Database Configuration
All tests run against SQLite:memory: — no separate database server is required. The full environment override is declared in phpunit.xml:
BCRYPT_ROUNDS=4— dramatically speeds up any tests that create users with hashed passwordsQUEUE_CONNECTION=sync— queued jobs execute immediately in-process during testsCACHE_STORE=array/SESSION_DRIVER=array— fully in-memory, no filesystem side-effectsPULSE_ENABLED=false/TELESCOPE_ENABLED=false— disables observability packages that would otherwise record test traffic
Running Tests
Run via the Composer shortcut
The
composer test script runs three steps in sequence: clears the config cache, performs a Pint dry-run style check (composer lint:check), and then executes the full test suite via php artisan test:Running individual suites
Code Style Tools
PatoLab enforces consistent style across both the PHP and TypeScript codebases. All tools are available as Composer or npm scripts.PHP — Laravel Pint
Laravel Pint applies the default Laravel coding style using thephp-cs-fixer engine.
--parallel for faster execution on multi-core machines.
JavaScript / TypeScript — ESLint
ESLint enforces import ordering and requires consistent type imports (separate type-only imports at the top level).shadcn/ui components under
resources/js/components/ui/ are excluded from ESLint rules, as they are generated/managed by the shadcn CLI and should not be manually reformatted.JavaScript / TypeScript — Prettier
Prettier enforces consistent formatting (4-space indent, single quotes, semicolons, Tailwind CSS class sorting viaprettier-plugin-tailwindcss).
TypeScript — type checking
tsc --noEmit to catch type errors across the entire React/TypeScript codebase without emitting any output files.
CI Pipeline
The CI pipeline runs on PHP 8.3, 8.4, and 8.5 to ensure forward compatibility. For each PHP version it:- Installs Node dependencies (
npm i) - Installs Composer dependencies
- Copies
.env.exampleto.envand generates an application key - Builds frontend assets (
npm run build) - Executes
./vendor/bin/pestdirectly
.npmrc sets ignore-scripts=true.PatoLab’s .npmrc disables npm lifecycle scripts globally. This means prepare, postinstall, and similar hooks will not run automatically after npm install or npm ci. If a package relies on a lifecycle script (e.g. to compile native bindings), you will need to run it manually. This is intentional and prevents unexpected side-effects in CI.