PHP code example of funkatron / funit

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

    

funkatron / funit example snippets

 php

t as fu;  // note the alias to "fu" for terseness

fu::test("this is a test", function() {
	fu::ok(1, "the integer '1' is okay");
	fu::ok(0, "the integer '0' is not okay"); // this will fail!
});

$exit_code = fu::run();
exit($exit_code);
 php

t as fu;

fu::test("this is a test", function() {
    fu::ok(1, "the integer '1' is okay");
    fu::ok(0, "the integer '0' is not okay"); // this will fail!
});

fu::run();
 php
 php
$loader->registerNamespace('FUnit', 'path/to/vendor/FUnit');
 php
use \FUnit as fu