PHP code example of swew / test
1. Go to this page and download the library: Download swew/test 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/ */
swew / test example snippets
// example.spec.php
declare(strict_types=1);
it('Test 1', function () {
expect(10)->not()->toBe(1);
});
it('Test 2: with dataset', function (int $num, int $n2 = 3) {
$a = str_repeat("Hello", $num * 100000);
return $a;
})->with([
1,
[2, 3]
]);
it('Test 3: skip', function () {
sleep(2);
})->skip();