kreemers / template
包模板
1.0.0
2019-06-08 12:17 UTC
Requires
- php: >=7.2
Requires (Dev)
- doctrine/coding-standard: ^6.0
- infection/infection: ^0.13.1
- phpunit/phpunit: ^8.2
- squizlabs/php_codesniffer: ^3.4
- symfony/var-dumper: ^4.3
- vimeo/psalm: ^3.4
This package is auto-updated.
Last update: 2024-09-12 20:24:00 UTC
README
PHP Composer 包模板
此仓库提供了一个 Composer 包的骨架。
用法
运行 composer create-project kreemers/template
预安装和配置的功能
- PHPUnit https://phpunit.de(带 Scrutinizer 代码覆盖率)
- Psalm https://github.com/vimeo/psalm(静态代码分析)
- PHP_CodeSniffer https://github.com/squizlabs/PHP_CodeSniffer(带 Doctrine 标准)
- Travis CI https://travis-ci.org
- Scrutinizer https://scrutinizer-ci.com
- Infection https://github.com/infection/infection(突变测试框架)
Composer 脚本
composer run test
在您的开发环境中运行测试(CodeSniffer -> Psalm -> PHPUnit)
composer run fix
运行 CodeFixer 以自动修复代码风格问题
composer run infection
运行突变测试
总的来说,它
- 运行测试套件以查看所有测试是否通过
- 使用一组预定义的突变器(突变算子)对源代码进行突变
- 对于每个突变体(更改后包含一个变化的修改后的代码),它运行覆盖更改行的测试
- 分析测试是否开始失败
- 收集已杀死、逃逸的突变体、错误和超时的结果
查看:https://infection.github.io/guide/#What-is-Infection
composer run ci
用于在 CI 环境(例如 Travis CI)中运行测试并创建覆盖率报告