1. Go to this page and download the library: Download detain/test-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/ */
detain / test-generator example snippets
declare(strict_types=1);
namespace Detain\TestGenerator;
use Twig_TemplateWrapper;
class TwigRenderer
{
// ...
public function __construct(\Twig_Environment $twig, TemplateConfiguration $templateConfiguration)
{
// ...
}
// ...
}
namespace Detain\PhpDependencies\Analyser;
use Mockery;
use Mockery\MockInterface;
use Vendor\TestCase;
class StaticAnalyserTest extends TestCase
{
/** @var StaticAnalyser */
private $classUnderTest;
/** @var PhpParser\NodeTraverser | MockInterface */
private $mockNodeTraverser;
/** @var Detain\PhpDependencies\Analyser\DependencyInspectionVisitor | MockInterface */
private $mockDependencyInspectionVisitor;
/** @var Detain\PhpDependencies\Analyser\Parser | MockInterface */
private $mockParser;
protected function setUp()
{
$this->mockNodeTraverser = Mockery::mock(PhpParser\NodeTraverser::class);
$this->mockDependencyInspectionVisitor = Mockery::mock(Detain\PhpDependencies\Analyser\DependencyInspectionVisitor::class);
$this->mockParser = Mockery::mock(Detain\PhpDependencies\Analyser\Parser::class);
$this->classUnderTest = new StaticAnalyser(
$this->mockNodeTraverser,
$this->mockDependencyInspectionVisitor,
$this->mockParser
);
}
public function testMissing()
{
$this->fail('Test not yet implemented');
}
}
bash
git clone https://github.com/detain/php-test-generator
cd php-test-generator
composer install
bin/test-generator --help
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.