Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Integration Tests Laravel Package

cache/integration-tests

Integration test suite for validating PSR-6 cache pools, taggable cache pools, and PSR-16 simple caches against PHP-FIG rules. Install as a dev dependency and extend the provided PHPUnit base tests to verify your cache implementation.

View on GitHub
Deep Wiki
Context7

Getting Started

Install as a dev dependency with composer require --dev cache/integration-tests@dev-master. Create a minimal test class extending CachePoolTest (for PSR-6), TaggableCachePoolTest (for taggable PSR-6), or SimpleCacheTest (for PSR-16), and implement the required factory method (createCachePool() or createSimpleCache()) to return your implementation instance. Run tests with phpunit — no configuration needed beyond standard PHPUnit setup. This is the fastest path to validate your cache adapter against official PSR standards.

Implementation Patterns

Use this package to validate all custom cache implementations in CI pipelines — especially useful for Laravel projects developing third-party adapters (e.g., Redis, DynamoDB, Doctrine DBAL-backed pools). Structure tests into separate classes: one for core pool behavior, another for tagging if applicable. When building adapters for Laravel’s CacheManager, ensure your implementation aligns with Laravel’s expectations and passes these stricter PSR specs. Leverage deferred item tests (testDeferred, testCommit) to validate lazy-write logic, and tag-related tests (testTaggedItems, testTagsRemoveItems) to confirm proper interaction with Cache\Adapter\Common\TaggableCacheItemPoolInterface. Always run phpunit --group=tag or similar to isolate feature-specific checks.

Gotchas and Tips

⚠️ Critical: No stable release since 2020 — pin to a specific commit ("cache/integration-tests": "dev-master#<sha>") in composer.json to avoid CI breakage from master instability.
⚠️ The tests enforce strict PSR semantics: expiresAfter(null) must not expire (not 0 or default TTL); expired items may still be returned by get() unless isHit() is checked — do not assume get() returns null for expired items.
⚠️ For PSR-16 getMultiple()/setMultiple() etc., exceptions must be thrown before iterating results (verified since v0.15.0), so avoid lazy validation.
⚠️ Verify your implementation uses the correct PSR namespace (Psr\Cache), not aliases like Cache\Contract — mismatched class resolution causes cryptic test failures.
💡 Tip: Run tests on PHP 8.0+ with PHPUnit ≥9.5 to match the last-known-compliant environment (v0.17.0 added PHP8 support); earlier versions may emit deprecation warnings.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport