https://github.com/try-php/predict-output
Prediction package for CLI output
https://github.com/try-php/predict-output
php7 test testing tryphp
Last synced: over 1 year ago
JSON representation
Prediction package for CLI output
- Host: GitHub
- URL: https://github.com/try-php/predict-output
- Owner: try-php
- License: gpl-2.0
- Created: 2017-10-21T15:40:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-21T15:50:04.000Z (over 8 years ago)
- Last Synced: 2025-01-30T16:37:42.452Z (over 1 year ago)
- Topics: php7, test, testing, tryphp
- Language: PHP
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# predict-output
> Prediction package for CLI output
[](https://travis-ci.org/try-php/predict-output)
## Install
```bash
$ composer require try/predict-output
```
## Usage
```php
predictOutput(function () {
echo '\e[33msomething\n';
}, 'something'); // won't throw an exception
$assertions->predictOutput(function () {
echo '\e[33msomething\n';
}, 'something other'); // will throw an exception
```
## API
### Methods
#### `predictOutput($capture, $content)`
Method to compare an output capture with a given string.
##### Arguments
| Arguments | Type | Description |
|---|---|---|
| $capture | `callable` | Closure from which every output buffer write will be captured. |
| $content | `string` | Content to which the output will be compared to. |
## License
GPL-2.0 © Willi Eßer