PHP code example of michaeldoehler / phpunit-generator
1. Go to this page and download the library: Download michaeldoehler/phpunit-generator 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/ */
michaeldoehler / phpunit-generator example snippets
//instantiate configuration
$configuration = \PhpUnitTestGenerator\Configuration\Configuration::getInstance();
//overwrite base class, per default \PHPUnit_Framework_TestCase is used
//$configuration->setBaseClass("");
//set source directory of classes
$configuration->setSourceDirectory(dirname(__FILE__) . '/example/src');
//set target directory of classes
$configuration->setTargetDirectory(dirname(__FILE__) . '/example/test');
//configure namespace mappings, e.g. if your tests exists in different namespace
$configuration->setNamespaceMappings(array(
"Example" => "Example\\Tests",
));
php phpunit-generator.php generate
php phpunit-generator.php test