Download the PHP package ralphjsmit/pest-plugin-filesystem without Composer
On this page you can find all versions of the php package ralphjsmit/pest-plugin-filesystem. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pest-plugin-filesystem
Handy filesystem helpers for your Pest tests
Testing with Pest is an absolute pleasure, but sometimes you just need that little bit extra. In my case, that extra was a set of expectations and functions to interact with the filesystem and make assertions on it. Below I made a list with all the helpers currently available. Enjoy!
[!IMPORTANT]
This package will only work for Pest V1 and not for Pest V2.
Contents
- Expectations
- expect(...)->toHaveContents()
- expect(...)->toExist()
- expect(...)->toHaveNamespace()
- Higher-order expectations
- expect(...)->contents->toBe(...)
- Functions
- rm($path, $allowNonExisting)
- rmdir_recursive($dir)
- contents($path)
- expectFailedAssertion()
Expectations
expect(...)->toHaveContents()
Test whether a file has certain contents:
expect(...)->toExist()
Test whether a file exists:
expect(...)->toHaveNamespace()
Test whether a file has a certain namespace (PHP-only):
Higher-order expectations
expect(...)->contents->toBe(...)
Make assertions on the contents of a file:
Functions
rm($path, $allowNonExisting)
Completely remove a file or directory:
rmdir_recursive($dir)
This function recursively deletes a folder, including its contents. Internally this is used by the rm()
function:
contents($path)
Gets the file contents of a certain file. Its simply a shorter wrapper for file_get_contents()
:
expectFailedAssertion()
Note that this helper will be added to another package soon and thus be removed here.
Expect a failed assertion. Helpful for testing your own custom Pest assertions:
General
🐞 If you spot a bug, please submit a detailed issue and I'll try to fix it as soon as possible.
🔐 If you discover a vulnerability, please review our security policy.
🙌 If you want to contribute, please submit a pull request. All PRs will be fully credited. If you're unsure whether I'd accept your idea, feel free to contact me!
🙋♂️ Ralph J. Smit
All versions of pest-plugin-filesystem with dependencies
illuminate/support Version ^8.76|^9.0|^10.0
pestphp/pest Version ^1.17
pestphp/pest-plugin Version ^1.0