承接 dataground/recursive-phpunit-test-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-22