[ticket/16961] Use virtual filesystem in tests#6982
Open
rubencm wants to merge 10 commits into
Open
Conversation
phpBB/composer.lockDev Package changes
Settings · Docs · Powered by Private Packagist |
rubencm
marked this pull request as draft
July 12, 2026 01:49
rubencm
force-pushed
the
ticket/16961
branch
2 times, most recently
from
July 12, 2026 09:44
2a6d356 to
06af0ef
Compare
rubencm
marked this pull request as ready for review
July 12, 2026 10:27
There was a problem hiding this comment.
Pull request overview
This PR updates phpBB’s PHPUnit suite to use a virtual filesystem (vfsStream) for file-based fixtures, caches, and temp directories, reducing reliance on the host filesystem and improving test isolation/portability. It also adjusts a couple of production components to better support stream-wrapper paths used by the new tests.
Changes:
- Add
mikey179/vfsstreamto dev dependencies and migrate many tests to write intovfs://instead oftests/**/tmpor repo paths. - Update DI/container caching tests to use a configurable cache directory and avoid direct filesystem cleanup.
- Replace
glob()usage in the s9e factory tidy routine and adjust local storage adapter path resolution to better handle stream wrappers.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/upload/fileupload_test.php | Switch upload fixtures/copies to vfs paths. |
| tests/upload/filespec_test.php | Replace real FS copy-setup with vfs-backed fixture copies. |
| tests/update/get_updates_test.php | Store download/signature artifacts in vfs tmp and remove manual cleanup. |
| tests/update/controller_test.php | Use vfs root for store/update artifacts and factor file creation helper. |
| tests/text_formatter/s9e/renderer_test.php | Use vfs cache directory for renderer cache. |
| tests/text_formatter/s9e/factory_test.php | Use vfs cache directory and remove manual unlink cleanup. |
| tests/test_framework/phpbb_test_case_helpers.php | Create/use vfs-backed s9e cache directory for formatter services. |
| tests/storage/adapter/local_test.php | Rely on vfs-backed local adapter test case cleanup instead of unlink. |
| tests/storage/adapter/local_test_case.php | Configure local storage adapter against vfs root path. |
| tests/mock/phpbb_di_container_builder.php | Allow container/autoload cache files to be written to an injected cache dir. |
| tests/mimetype/guesser_test.php | Use vfs fixtures for jpg paths while keeping binary guesser fixtures on real FS. |
| tests/messenger/queue_test.php | Move queue cache file into vfs tmp. |
| tests/lock/posting_test.php | Use vfs tmp directory for file cache driver. |
| tests/lock/flock_test.php | Use vfs for non-fork lock tests; keep real FS path for forked-process test. |
| tests/di/fixtures/manager_mock.php | Extract extension manager mock into a fixture file. |
| tests/di/create_container_test.php | Use vfs cache dir for dumped container output. |
| tests/di/container_cache_directory_test.php | Use vfs cache dirs and scandir-based assertions for cached artifacts. |
| tests/console/thumbnail_test.php | Use vfs for storage and temp paths; update storage mock callbacks accordingly. |
| tests/console/cache/purge_test.php | Use vfs cache dir and remove manual directory management helpers. |
| tests/cache/file_driver_test.php | Use vfs cache dir and remove manual cleanup helpers. |
| phpBB/phpbb/textformatter/s9e/factory.php | Replace glob() with scandir() for cache cleanup to work with vfs. |
| phpBB/phpbb/storage/adapter/local.php | Adjust root path resolution to better handle wrappers where realpath() fails. |
| phpBB/composer.lock | Lockfile update including vfsStream package. |
| phpBB/composer.json | Add mikey179/vfsstream to dev requirements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PHPBB-16961
…lenames PHPBB-16961
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PHPBB-16961
Checklist:
Tracker ticket:
https://tracker.phpbb.com/browse/PHPBB-12345