Test environment hardening: APP_KEY override and Postgres test runs #22
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Two related test-environment gaps surfaced during ticket #4 review:
1.
APP_KEYnot overridden inphpunit.xmlTests use the local
.envAPP_KEY. If a real production key is ever committed to.env(mistake or otherwise), encryption-bound tests could leak across environments. Defensible practice: pin a known testing-onlyAPP_KEYinphpunit.xml<server>block.2. Test/prod DB engine split
phpunit.xmlforcesDB_CONNECTION=sqlite:memory:, but production runs PostgreSQL 17. This means:timestampTz()columns compile to plaindatetimeon SQLite — TZ behavior never tested.tsvector, JSON ops) are untestable.Goals
APP_KEYtophpunit.xml<server>overrides with a known value.Acceptance criteria
<server name="APP_KEY" value="base64:..."/>(test-only key) in phpunit.xml.Risks