定制 wickedone/muppet 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

wickedone/muppet

最新稳定版本:2.0.0

Composer 安装命令:

composer require --dev wickedone/muppet

包简介

testing your getters, setters, adders, removers, issers and whatevers

README 文档

README

unit testing your getters, setters, adders, removers, issers and whatevers.

Mutation testing badge Type Coverage codecov PHPStan static analysis coding standards

installation

to add this library to your dev dependencies use

composer require --dev wickedone/muppet

but why?

a lot has been written about the necessity of testing your getters and setters or why it shouldn't been done. from my personal perspective, testing getters and setters provide a stable level of coverage and thus the ability to pin your ci to a minimum coverage value.

what it does

this library doesn't promise to generate perfect, non failing tests out of the box (though it tries). it does however generate test classes which are easy to modify and, most importantly, are compatible with infection (i.e. not too much black magic fuckery).

usage

$config = new Config(
  '~/Code/Project/src',  // base dir
  '~/Code/Project/tests/Unit', // tests dir
  // namespace fragments
  [
    'Awesome',
    'Namespace',
    'Tests',
    'Unit',
  ],
  'foo <bar@qux.com>' // author (optional)
);

(new Generator($config))
  ->generate('MyEntity')
;

assumptions

because we love those...

  • iterable properties use adders and removers rather than setters
  • removers return booleans: true on removal, false otherwise
  • Tests is part of the tests namespace

symfony integration

please see the muppet-bundle

统计信息

  • 总下载量: 8.06k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-03