commit compras 2711
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-27 13:49:31 +02:00
parent dc73540558
commit e709d900d1
81 changed files with 5352 additions and 107 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
use Illuminate\Support\Facades\DB;
/** Clear a manually assigned CLI fixture actor without rotating a user's remember token. */
function clearImportQaIdentity(): void
{
$db = DB::connection();
$isolated = ($db->getDriverName() === 'sqlite' && $db->getDatabaseName() === ':memory:')
|| ($db->getDriverName() === 'pgsql' && preg_match('/^compras_receipts_test_[a-f0-9]{12}$/D', $db->getDatabaseName()));
if (! app()->environment('testing') || ! app()->runningInConsole() || ! $isolated || request()->hasSession()) {
throw new LogicException('Only a sessionless disposable CLI fixture actor may be cleared this way.');
}
auth()->forgetGuards();
if (auth()->check()) {
throw new LogicException('The synthetic inspection still has an authenticated actor.');
}
}