2026-05-08 09:37:16 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Tests;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
|
|
|
|
|
|
|
|
|
abstract class TestCase extends BaseTestCase
|
|
|
|
|
{
|
2026-05-16 09:57:32 +03:00
|
|
|
protected function setUp(): void
|
|
|
|
|
{
|
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
|
|
// Quirk 72: supplier code (SupplierPortalClient::loadSession,
|
|
|
|
|
// RefreshSupplierSessionJob, CsvReconcileJob, RouteSupplierLeadJob)
|
|
|
|
|
// hardcodes Cache::store('redis'), bypassing phpunit.xml's
|
|
|
|
|
// CACHE_STORE=array. The Redis store is a shared external service —
|
|
|
|
|
// under `pest --parallel` every worker collides on the global
|
|
|
|
|
// `supplier:session` key, so one worker's afterEach forget()/flush()
|
|
|
|
|
// races another worker's mid-test loadSession(). Repoint the `redis`
|
|
|
|
|
// cache store at the in-process `array` driver: each worker then gets
|
|
|
|
|
// a hermetic, worker-local cache. Production keeps the real `redis`
|
|
|
|
|
// driver — this override only ever runs under APP_ENV=testing.
|
|
|
|
|
config(['cache.stores.redis.driver' => 'array']);
|
|
|
|
|
}
|
2026-05-08 09:37:16 +03:00
|
|
|
}
|