The test suite verifies the implemented behavior of config loading, path normalization, filtering, and real filesystem traversal.
Run the suite with:
composer testphp tests/run.php
The repository uses a custom test runner.
It discovers *Test.php files under tests/ and executes them through tests/bootstrap.php.
The suite is organized by behavior:
tests/Config/- YAML loading
- merge behavior
- validation
- value objects
- exception behavior
tests/Filesystem/- path normalization
- path filtering
tests/Integration/- end-to-end config plus traversal
- recursive and non-recursive roots
- hidden paths
- symlinks
- unreadable paths
Filesystem tests use real temporary directories created by TemporaryFilesystem.
Typical pattern:
- create a temporary root
- write real directories and files
- configure discovery against that root
- run
FileLocator - assert on yielded normalized absolute paths
- clean up the temporary tree
This keeps tests close to the actual runtime behavior of the library.
Any change affecting discovery behavior should preserve coverage for:
- default config loading
- project override precedence
- config merge rules
- schema validation failures
- path normalization failures
- global exclusions
- root-specific exclusions
- nested directories
- recursive and non-recursive roots
- hidden files and directories
- symlink behavior with follow disabled and enabled
- unreadable paths with
skipandfail
Some tests depend on host capabilities:
- symlink tests are skipped on Windows
- unreadable-path tests are skipped on Windows
- unreadable-path tests are skipped when running as root on POSIX systems
When validating permission-sensitive behavior, run the suite in an environment that matches the target deployment model.