PHP code example of md / eris-runner
1. Go to this page and download the library: Download md/eris-runner library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
md / eris-runner example snippets
property ("strings have the same length in reverse", function() {
forAll (Gen::string()) (function ($s) {
Assert::same(strlen($s), strlen(strrev($s)));
});
});
property ("positive integers squared are always bigger than themselves", function() {
forAll (Gen::integer())
// ok zero * zero is still zero
->when (function($x) { return $x > 0; })
->then (function ($x) {
// Should fail! Did you think about 1? ;-)
Assert::greaterThan($x * $x, $x);
});
});