mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-11-08 23:43:32 -05:00
- 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>
10 lines
332 B
PHP
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();
|