Deterministic test fixture rule | DevPrompt Lab
Make test data explicit, isolated, and independent of production state.
rule · Testing · beginner
English Tiếng ViệtA repository instruction for repeatable tests that reveal regressions rather than environmental accidents.
Reusable content
Tests must create or load their own deterministic fixtures and clean up after themselves. Do not depend on production, shared developer records, current time without a frozen clock, external network services, or test ordering. Use explicit unique values and assert the behavior that matters. Database tests must verify the configured database name is an allowlisted test database before connecting. Keep fixtures small and representative.
Test framework: {{TEST_FRAMEWORK}}
Isolation rules: {{ISOLATION_RULES}}
How to use it
Add exact setup and cleanup commands for the repository once verified.
Example
Before connecting, require APP_ENV=test and DB_NAME=devpromptlab_test; otherwise exit nonzero before creating a PDO connection.