cooper / hyperf-pest
Pest Testing for hyperf
v1.1.0
2023-07-20 00:42 UTC
Requires
- php: >=8.0
- hyperf/contract: ~3.0.0
- hyperf/di: ~3.0.0
- hyperf/utils: ~3.0.0
- pestphp/pest: ~1.23.0
Requires (Dev)
- composer/composer: ^2.0
- friendsofphp/php-cs-fixer: ^3.0
- hyperf/testing: ~3.0.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^9.6
- swoole/ide-helper: ^5.0
Suggests
- swow/swow: Required to create swow components.
This package is auto-updated.
Last update: 2024-12-20 03:35:34 UTC
README
Pest 是一个注重简单性的优雅 PHP 测试框架.
1.安装 Hyperf-skeleton (已有 Hyperf 项目请忽略)
https://github.com/hyperf/hyperf-skeleton
composer create-project hyperf/hyperf-skeleton
2.使用 Composer 安装
composer require cooper/hyperf-pest
执行
php bin/hyperf.php vendor:publish cooper/hyperf-pest
3.测试命令
./vendor/bin/co-pest --prepend test/bootstrap.php -c phpunit.xml
提示
- 在
composer.json
中scripts
添加命令快捷方式:"pest": "co-pest --prepend test/bootstrap.php -c phpunit.xml --colors=always"
; - 语法请看官方文档;
- 按照
phpunit
写测试也是可以的。
License
The MIT License (MIT). Please see License File for more information.