diff --git a/tests/RedisCacheTest.php b/tests/RedisCacheTest.php index d214fcb..7a56229 100644 --- a/tests/RedisCacheTest.php +++ b/tests/RedisCacheTest.php @@ -17,14 +17,22 @@ use PHPUnit\Framework\TestCase; /** * Tests for Redis-backed caching. + * + * Requires REDIS_URL environment variable. Tests will skip if not set. */ class RedisCacheTest extends TestCase { private CacheInterface $redisCache; - private string $redisUrl = 'REDIS_URL_FROM_ENV'; + private ?string $redisUrl = null; protected function setUp(): void { + $this->redisUrl = getenv('REDIS_URL') ?: null; + + if ($this->redisUrl === null) { + $this->markTestSkipped('REDIS_URL not set, skipping Redis tests'); + } + $this->redisCache = RedisCache::fromUrl($this->redisUrl, 'test_ctx:'); }