hot/phpunit-runner
Composer 安装命令:
composer require hot/phpunit-runner
包简介
The lib allows to watch phpunit tests
README 文档
README
Requirements: php, phpunit, git, find
Watcher for php classes and tests
bin/hot-phpunit-runner --config=app/phpunit.xml --watch
- When you change entity
XXXClassthis watcher looking for and run tests for this entity. - When you change test for entity
XXXClassTestthis watcher run this test too.
PHPUnit HotRunner has been started
> phpunit -c app/phpunit.xml ./src/.../....../XXXClassTest.php
PHPUnit 3.7.21 by Sebastian Bergmann.
Configuration read from /Users/slava/project/xxx/app/phpunit.xml
....
Time: 1 second, Memory: 10.00Mb
OK (4 tests, 9 assertions)
[OK]
[notice] If you run bin/hot-phpunit-runner without any options then you
run all tests (or test for entity) based on git status (one time).
FYI, runner will not run tests next time. ( result is cached for watcher )
Default running looks like:
bin/hot-phpunit-runner --watchbin/hot-phpunit-runner --config=app/phpunit.xml --watch
Options
--config=app/phpunit.xml # custom phpunit config file
--phpunit-options="-c app/ --testdox" # custom phpunit options (alternative for `--config`)
--phpunit-bin=bin/phpunit # custom path to phpunit
--watch # watcher mode
--period=2 # sec. watcher period
--clean # this option remove cached result and re-test full
--test-similarity=100 # percentage of similarity 0..100 (entity vs test)
--coverage=coverage.xml # collect coverage and write Clover xml
--on-pass="echo 'pass callback';" # CLI command after pass
--on-fail="echo 'fail callback';" # CLI command after fail
--notify # notifications # OSX / UBUNTU notifications
Install
- composer:
"hot/phpunit-runner": "dev-master" - http://packagist.org/packages/hot/phpunit-runner
- https://github.com/slavahatnuke/hot-phpunit-runner
Workflows
bin/hot-phpunit-runner --watch# default watcherbin/hot-phpunit-runner --config=app/phpunit.xml --watch# with phpunit config filebin/hot-phpunit-runner --config=app/phpunit.xml --phpunit-bin=bin/phpunit --watch# with customphpunitbin/hot-phpunit-runner --clean# clear cache and re-test changeset (when watcher working)bin/hot-phpunit-runner --config=app/phpunit.xml --watch --period=1# with phpunit config hot watcher with--period=1bin/hot-phpunit-runner --config=app/phpunit.xml --watch &# with phpunit config file and with&(background process)bin/hot-phpunit-runner --watch --test-similarity=50# default watcher with--test-similarity=50# watcher can not find my tests. I need to reduce the similarity.bin/hot-phpunit-runner --options="-c app/ --testdox" --watch# watcher with--options="-c app/ --testdox"# with custom phpunit optionsbin/hot-phpunit-runner --config=app/phpunit.xml --coverage=coverage.xml --watch# with--config=app/phpunit.xml --coverage=coverage.xml. collect coverage just for changesbin/hot-phpunit-runner --notify --watch# OSX / UBUNTU notifications
PhpStorm
Highlight coverage in PhpStorm
bin/hot-phpunit-runner --config=app/phpunit.xml --coverage=coverage.xml --watch # required --config=app/phpunit.xml phpunit config file, in this case runner collect coverage for changes
or
Notifications
bin/hot-phpunit-runner --notify --watch
--notify has dependents:
- OSX:
terminal-notifierhttps://github.com/alloy/terminal-notifier - UBUNTU:
notify-sendman
hot/phpunit-runner 适用场景与选型建议
hot/phpunit-runner 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 66.99k 次下载、GitHub Stars 达 29, 最近一次更新时间为 2013 年 09 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「phpunit」 「git」 「test」 「ci」 「observer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hot/phpunit-runner 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hot/phpunit-runner 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hot/phpunit-runner 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
HiDev plugin for PHPUnit
Testing Suite For Lumen like Laravel does.
A cli tool which generates unit tests.
Easily manage git hooks in your composer config
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
Nagios plugin to verify a git repository.
统计信息
- 总下载量: 66.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 30
- 点击次数: 27
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-09-17




