Files
opensourcepos/tests/bootstrap.php
T
objecttothis b57e727437 fix(security): restore in-memory encryption key on rollback failure
- security_helper.php: when rotateEncryptionKeyUnlock() fails and
  restores .env from backup, also resync config('Encryption')->key
  from restored file so in-memory state matches disk again; prevents
  stale key in shared Encryption config instance after failed rotation.
- phpunit.xml.dist: point bootstrap at new tests/bootstrap.php instead
  of vendor framework bootstrap directly.
- tests/bootstrap.php: new wrapper that requires framework bootstrap
  then calls checkEncryption() via security helper, so test suite
  provisions encryption key itself instead of relying on a prior
  Config controller hit to lazily create it.

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-10-21 11:35:49 +04:00

10 lines
332 B
PHP

<?php
require __DIR__ . '/../vendor/codeigniter4/framework/system/Test/bootstrap.php';
// Local/CI checkouts may never have hit a Config controller action that
// lazily provisions the encryption key, so the test suite needs to do it
// itself before anything touches Services::encrypter().
helper('security');
checkEncryption();