Files
L-Ami-Fiduciaire/tests/Feature/RedisConnectivityTest.php
Saad Ibn-Ezzoubayr fd43a6f429 feat: complete Epic 0 — foundation migration & infrastructure setup
Stories 0.2-0.5: rename folders→declarations (backend+frontend), configure
Redis for cache/queue/sessions, add foundation database migrations
(permissions, archived_at), replace DeclarationStatus enum with architecture
lifecycle values, create DeclarationObserver for status transition validation
and auto-archive, fix controller status transitions to respect observer rules.

93 tests pass (240 assertions).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 18:25:32 +00:00

36 lines
1.2 KiB
PHP

<?php
use Illuminate\Support\Facades\Cache;
test('redis cache driver can store and retrieve values', function () {
Cache::store('redis')->put('test-key', 'test-value', 60);
expect(Cache::store('redis')->get('test-key'))->toBe('test-value');
Cache::store('redis')->forget('test-key');
});
test('redis queue connection is configured in env', function () {
$env = collect(file(base_path('.env'), FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES))
->filter(fn ($line) => ! str_starts_with(trim($line), '#'))
->mapWithKeys(function ($line) {
[$key, $value] = explode('=', $line, 2);
return [trim($key) => trim($value)];
});
expect($env->get('QUEUE_CONNECTION'))->toBe('redis');
});
test('redis session driver is configured in env', function () {
$env = collect(file(base_path('.env'), FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES))
->filter(fn ($line) => ! str_starts_with(trim($line), '#'))
->mapWithKeys(function ($line) {
[$key, $value] = explode('=', $line, 2);
return [trim($key) => trim($value)];
});
expect($env->get('SESSION_DRIVER'))->toBe('redis');
});