PHP code example of gzhegow / test

1. Go to this page and download the library: Download gzhegow/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/ */

    

gzhegow / test example snippets




define('__DIR_ROOT__', __DIR__ . '/..');

\Gzhegow\Lib\Lib::entrypoint()
    ->setAllRecommended()
    //
    ->setCustomDirRoot(__DIR_ROOT__)
    //
    ->useAll()
    //
    ->lock()
;


$theDebug = \Gzhegow\Lib\Lib::debug();
$theTest = \Gzhegow\Lib\Lib::test();


// > TEST
$fn = function () use ($theDebug) {
    $theDebug->dump_value('TEST 1');
    echo PHP_EOL;
};
$test = $theTest->newCase($fn);
$test->expectStdout('
"TEST 1"
');
$test->run();