https://github.com/net-tools/phpunit-dump
Dump data generated during a PHPUnit testsuite to a file, mail, etc.
https://github.com/net-tools/phpunit-dump
Last synced: 12 months ago
JSON representation
Dump data generated during a PHPUnit testsuite to a file, mail, etc.
- Host: GitHub
- URL: https://github.com/net-tools/phpunit-dump
- Owner: net-tools
- License: mit
- Created: 2020-01-30T16:41:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-18T19:01:22.000Z (about 3 years ago)
- Last Synced: 2025-06-08T11:08:30.226Z (about 1 year ago)
- Language: PHP
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# net-tools/phpunit-dump
## Composer library to dump data from a PHPUnit testsuite
Sometimes we have to check some data produced by a unit test, but this can't be done with PHPUnit assertions.
This library makes it possible do dump this data to a file or to have the dump sent to a mail recipient, for further inspection.
## Setup instructions
To install net-tools/phpunit-dump package, just require it through composer : `require net-tools/phpunit-dump:^1.0.0`.
## How to use ?
The extension must be registered in PHPUnit xml config file. For example, to register `DumpToMail` extension class :
```xml
```
The other PHPUnit extension class is `DumpToFile` which write all data to files inside a given path :
```xml
```
Then, during a test, call the static method `DumpExtension::dump($name, $data)` to create a dump value ; `$data` and `$name` are string values (in the case of `DumpToFile`, `$name` will be the filename created for this dump).
At the end of the whole PHPUnit test, the values will be dumped (to files or as mail attachments).