PHP code example of wikidi / envtesting

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

    

wikidi / envtesting example snippets



e = new \envtesting\Suite('my great envtest');
$suite->addTest('APC', 'envtests/library/Apc.php', 'apc'); // by file
echo $suite;


::instance()->addTest('APC', 'envtests/library/Apc.php', 'apc'); // by file
echo Suite::instance();


e = new \envtesting\Suite('my great envtest');
$suite->addTest('SOMETHING', function() {
	if (true === false) throw new \envtesting\Error('True === false');
	}, 'boolean');


e = new \envtesting\Suite('my great envtest');
$suite->addTest('callback', array($test, 'perform_test'), 'callback');


e = new \envtesting\Suite('my great envtest');
$suite->addTest('callback', '\we\can\call\Something::static', 'call');


e = new \envtesting\Suite('my great envtest');
$suite->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');


e = new \envtesting\Suite('my great envtest');
$suite->group->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
$suite->group2->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');


e = new \envtesting\Suite('my great envtest');
$suite->group->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
$suite->group->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
$suite->group2->addTest('memcache', new \envtests\services\memcache\Connection('127.0.0.1', 11211), 'service');
$suite->shuffle(); // mix only groups
$suite->shuffle(true); // deep shuffle mix groups and tests inside group


e = new \envtesting\Suite('my great envtest');
echo $suite;            // generate TXT output
$suite->render('csv');  // render CSV output
$suite->render('html'); // render HTML output