26/10
2017
Wallogit.com
2017 © Pedro Peláez
Simple comparison prediction for scalar values
Simple comparison prediction for scalar values, (*1)
$ composer require try/predict-is
<?php
require_once '/path/to/autoload.php';
use TryPhp\PredictIsTrait;
$assertions = new class() {
use PredictIsTrait();
}
$assertions->is(3, 3); // won't throw an exception
$assertions->predictException('something', 'something else'); // will throw an exception
is($actual, $expected)Method to compare scalar values and throw an Exception if they do not equal., (*3)
| Arguments | Type | Description |
|---|---|---|
| $actual | mixed |
Actual value that shall be checked. |
| $expected | mixed |
Expected value $actual is compared to. |
GPL-2.0 © Willi Eßer, (*4)