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
Flysystem Adapter Test Utilities

Flysystem Adapter Test Utilities Laravel Package

league/flysystem-adapter-test-utilities

Helper utilities for testing Flysystem adapters. Add as a dev dependency to reuse common adapter test cases and assertions while developing or verifying custom filesystem adapters. Part of the Flysystem project; see main docs and repo for issues/PRs.

View on GitHub
Deep Wiki
Context7

Flysystem utilities for testing adapters.

Frequently asked questions about Flysystem Adapter Test Utilities
How do I install this package for Laravel storage adapter testing?
Run `composer require --dev league/flysystem-adapter-test-utilities` in your project. It’s a dev dependency only, so it won’t affect production. Ensure your Laravel app uses league/flysystem (v1 or v2) for storage adapters.
Can I use this with Laravel’s built-in Filesystem facade?
Yes, since Laravel’s Filesystem facade relies on Flysystem adapters (e.g., S3, local), you can test custom adapters or extend Laravel’s storage logic. The package provides utilities like `TestUtil::createTestAdapter()` for isolated testing.
What Laravel versions and Flysystem versions does this support?
This package works with any Laravel version (5.5+) as long as you’re using league/flysystem v1.x or v2.x. Check the package’s `composer.json` for exact Flysystem version constraints—mismatches can cause test failures.
How do I test edge cases like file permissions or large uploads?
Use `TestUtil::assertDirectoryStructure()` and `TestUtil::assertFileContents()` to validate permissions, metadata, and content. For large files, simulate uploads with mock adapters and verify chunked writes or error handling.
Will this slow down my CI/CD pipeline?
Minimal overhead—it’s purely a testing tool. However, if your tests are overly complex or flaky, consider optimizing assertions or running tests in parallel. Monitor CI/CD performance after integration.
Can I replace my custom PHPUnit mocks with this package?
Yes, but evaluate coverage first. This package provides reusable test cases for common adapter behaviors (e.g., file operations, directory traversal). Audit your existing tests to avoid duplication, especially if using Mockery or custom mocks.
How do I handle Flysystem v1 vs. v2 compatibility issues?
Check the package’s `composer.json` for supported Flysystem versions. If using v1, ensure the package isn’t hardcoded for v2 APIs. For Laravel, confirm your `filesystem.php` config aligns with the adapter’s Flysystem version.
Does this work with Laravel Forge/Vapor or cloud storage adapters?
Absolutely. Test cloud adapters (e.g., S3, DigitalOcean Spaces) by mocking them with `TestUtil::createTestAdapter()`. Validate behaviors like CORS, ACLs, or region-specific endpoints using the package’s assertions.
What if my adapter has custom logic not covered by this package?
Extend the package’s utilities or write custom test classes. The package is adapter-agnostic—you can mix its helpers with your own assertions. For example, add `TestUtil::assertCustomBehavior()` for proprietary logic.
Are there alternatives to this package for Laravel storage testing?
For basic testing, you might use PHPUnit’s mocks or Laravel’s `Storage` facade directly. However, this package offers pre-built test cases for Flysystem-specific edge cases (e.g., symlinks, hard links, or filesystem events). It’s ideal if you’re heavily invested in Flysystem.
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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle