try/predict-output

用于 CLI 输出的预测包

1.0.0 2017-10-21 15:49 UTC

This package is not auto-updated.

Last update: 2024-09-15 04:52:30 UTC


README

用于 CLI 输出的预测包

Build Status

安装

$ composer require try/predict-output

用法

<?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

方法

predictOutput($capture, $content)

方法用于比较捕获的输出与给定的字符串。

参数

许可证

GPL-2.0 © Willi Eßer