Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Roave/no-leaks
:potable_water: PHPUnit Plugin for detecting Memory Leaks in code and tests
https://github.com/Roave/no-leaks
Last synced: 3 months ago
JSON representation
:potable_water: PHPUnit Plugin for detecting Memory Leaks in code and tests
- Host: GitHub
- URL: https://github.com/Roave/no-leaks
- Owner: Roave
- License: mit
- Created: 2019-03-14T21:10:31.000Z (over 5 years ago)
- Default Branch: 1.6.x
- Last Pushed: 2024-05-22T12:04:45.000Z (6 months ago)
- Last Synced: 2024-05-22T13:28:53.698Z (6 months ago)
- Language: PHP
- Homepage:
- Size: 1.09 MB
- Stars: 497
- Watchers: 15
- Forks: 18
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# roave/no-leaks
[![Latest Stable Version](https://poser.pugx.org/roave/no-leaks/v/stable.png)](https://packagist.org/packages/roave/no-leaks)
![roave/no-leaks](./logo/no-leaks.png)
This library is a [PHPUnit](https://github.com/sebastianbergmann/phpunit) plugin
that detects memory leaks in tested code or tests.
It utilizes `memory_get_usage()` to make sure the code being executed properly cleans up after itself.## Installation
```sh
composer require --dev roave/no-leaks
```## Usage
```sh
vendor/bin/roave-no-leaks
```If any memory leaks are detected, you should see an output like
following:```text
Exception: The following test produced memory leaks:
* My\Leaky\Test::testSomething
* My\Leaky\Test::testSomethingElse
```## Configuration and Parameters
[`vendor/bin/roave-no-leaks`](./bin/roave-no-leaks) supports all
configuration parameters and console parameters of PHPUnit.## Known Issues
Please be aware that this is not a full substitute for PHPUnit:
* the output format is to be improved
* memory leak detection for scalar types and arrays is not reliable
* can fail depending on xdebug/phpdbg/php-sapi changes## Professional Support
If you need help with setting up this library in your project,
you can contact us at [email protected] for consulting/support.