try / predict-output
Prediction package for CLI output
1.0.0
2017-10-21 15:49 UTC
Requires
- try/clear-string: ^1.0
Requires (Dev)
- troublete/crayon: ^1.1
This package is not auto-updated.
Last update: 2025-01-05 06:41:06 UTC
README
Prediction package for CLI output
Install
$ composer require try/predict-output
Usage
<?php require_once '/path/to/autoload.php'; use TryPhp\PredictOutputTrait; $assertions = new class() { use PredictOutputTrait(); } $assertions->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
License
GPL-2.0 © Willi Eßer