Backend API tests fail - Redis extension not available #20

Closed
opened 2026-02-19 01:26:03 +00:00 by santhoshj · 0 comments
Owner

Problem

All 15 authentication API tests fail with error:
Class "Redis" not found

Details

  • Environment: PHP testing environment without Redis extension
  • Error location: vendor\laravel\framework\src\Illuminate\Redis\Connectors\PhpRedisConnector.php:80
  • Affected tests: All tests in Tests\Feature\Auth\AuthenticationTest

Root Cause

The .env file configures CACHE_STORE=redis and REDIS_CLIENT=phpredis, but phpunit.xml only overrides CACHE_STORE=array without disabling Redis entirely.

Proposed Solution

Add to phpunit.xml:
<env name="REDIS_CLIENT" value="null"/\u003e
<env name="REDIS_HOST" value="null"/\u003e

Test Output

Tests: 15 failed, 2 passed (2 assertions)

## Problem All 15 authentication API tests fail with error: Class \"Redis\" not found ## Details - Environment: PHP testing environment without Redis extension - Error location: vendor\laravel\framework\src\Illuminate\Redis\Connectors\PhpRedisConnector.php:80 - Affected tests: All tests in Tests\Feature\Auth\AuthenticationTest ## Root Cause The .env file configures CACHE_STORE=redis and REDIS_CLIENT=phpredis, but phpunit.xml only overrides CACHE_STORE=array without disabling Redis entirely. ## Proposed Solution Add to phpunit.xml: <env name=\"REDIS_CLIENT\" value=\"null\"/\u003e <env name=\"REDIS_HOST\" value=\"null\"/\u003e ## Test Output Tests: 15 failed, 2 passed (2 assertions)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: santhoshj/headroom#20