laminas/laminas-cache-storage-adapter-test
Test adapter for Laminas Cache storage. Provides a lightweight in-memory storage implementation useful for unit tests and CI, enabling predictable cache behavior without external services or persistent backends.
Illuminate/Cache) is built on PSR-6/PSR-16 standards, which aligns with Laminas Cache’s compatibility. This package could streamline testing of custom cache drivers (e.g., a Redis or database-backed adapter) by reusing validated test suites.CacheItemPoolInterface) and PSR-16 (SimpleCacheInterface)—directly applicable to Laravel’s cache abstractions.--dev, so no runtime impact.laminas/laminas-cache (v4+) for full feature parity, but core tests may work with Laravel’s built-in cache interfaces.cache()->rememberForever()) may not be covered, but core PSR compliance is sufficient for most use cases.^4.1) to avoid breaking changes.Illuminate/Contracts/Cache/Store).cache()->tags())? Probably irrelevant—this is for storage adapters, not the facade.CacheTestCase (in illuminate/cache) covers basic functionality. Is this package’s PSR-focused scope more valuable?refreshApplication() to clear cache between tests).StorageInterface vs. Laravel’s Store interface).composer require --dev laminas/laminas-cache-storage-adapter-test
AbstractCacheItemPoolIntegrationTest).use Laminas\Cache\Storage\Adapter\Test\AbstractCacheItemPoolIntegrationTest;
class RedisCacheTest extends AbstractCacheItemPoolIntegrationTest {
protected function createCacheItemPool(): CacheItemPoolInterface {
return new RedisStore(app('redis'));
}
}
CacheStoredEvent) are not in scope.cache()-> methods).LaminasCacheStore), integration is seamless.Psr6CacheStore) for compatibility.^4.1 to avoid major version risks.tinker) can inspect cache state during test failures.refreshApplication() or Artisan::call('cache:clear') between tests.laminas/laminas-cache:^4.0).phpunit.xml:
<testsuites>
<testsuite name="Cache">
<directory>./tests/Cache</directory>
</testsuite>
</testsuites>
How can I help you explore Laravel packages today?