Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebastianbergmann/phpunit-memprof-listener
Test Listener for PHPUnit that can dump memory profile information
https://github.com/sebastianbergmann/phpunit-memprof-listener
Last synced: about 2 months ago
JSON representation
Test Listener for PHPUnit that can dump memory profile information
- Host: GitHub
- URL: https://github.com/sebastianbergmann/phpunit-memprof-listener
- Owner: sebastianbergmann
- License: other
- Archived: true
- Created: 2018-01-05T17:02:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-23T09:11:22.000Z (about 5 years ago)
- Last Synced: 2024-09-21T10:04:06.912Z (2 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# phpunit-memprof-listener
Test Listener for [PHPUnit](https://github.com/sebastianbergmann/phpunit/) that uses the [memprof](https://github.com/arnaud-lb/php-memory-profiler) extension to dump memory profile information.
## Installation
You can add this library as a local, per-project, development-time dependency to your project using [Composer](https://getcomposer.org/):
composer require --dev phpunit/phpunit-memprof-listener
## Usage
The example below shows how you activate and configure this test listener in your PHPUnit XML configuration file:
```xml
tests
src
/tmp
callgrind
```
The following elements are relevant to this test listener and its configuration:
* `` is the configuration section for test listeners
* `` configures (an instance of) the `PHPUnit\MemoryProfiler\TestListener` class as a test listener
* `` is the configuration for that test listener
* The first argument is the path to the directory where the memory profile information is to be dumped, in this example `/tmp`
* The second argument is the desired format for the memory profile information dump, in this example `callgrind` (valid values are `callgrind` and `pprof`)The rest of the `phpunit.xml` example shown above are best practice configuration defaults that were generated using `phpunit --generate-configuration`.