dataground/recursive-phpunit-test-generator
最新稳定版本:2.0.4
Composer 安装命令:
composer require dataground/recursive-phpunit-test-generator
包简介
Recursively create PhpUnit test skeletons by convention for a composer project using PSR autoloading and naming
README 文档
README
Recursively create PhpUnit test skeletons by convention for a composer project using PSR autoloading and naming. It will generate skeleton tests for all classes in the source folder recursively. It will skip interfaces and existing tests. Target folders will be created based on source folders.
Usage
php bin/testcreator /my/project /my/project/tests/unit
Example class (src/My/NameSpace/Foo.php)
namespace My\NameSpace;
class Foo {
public function bar() {
... some code
}
}
Resulting test (test/unit/My/NameSpace/FooTest.php)
namespace My\NameSpace;
/*
@TODO Public API to cover:
@covers My\NameSpace\Foo::bar()
*/
class FooTest extends TestCase {
/**
* @type My\NameSpace\Foo;
*/
private $foo = null;
/**
*
*/
protected function setUp():void
{
parent::setUp();
// $this->foo = new Foo( ... );
}
/**
*
*/
protected function tearDown():void
{
// $this->foo = null;
parent::tearDown();
}
/**
*
*/
public function testTodo()
{
$this->markTestSkipped('Tests not implemented yet for Foo');
}
}
TODO
- Put logic in classes
- Add tests (duh..)
统计信息
- 总下载量: 1.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-06-22