hmlb/phpunit-vw
Composer 安装命令:
composer require hmlb/phpunit-vw
包简介
VW PhpUnit makes your failing tests pass CI tools scrutiny!
README 文档
README
VW makes failing test cases succeed in continuous integration tools.
Your primary objective is to ship more code to the world. No need to be slowed down by regressions or new bugs that happen during development.
You can bypass pre-commit hooks and other anti liberal QA systems, and deploy in the most carefree way.
-
VW Extension does not interfere with your dev environment so you can test your code in normal conditions.
-
It automatically detects CI environments and makes your test suites succeed even with failing assertions or unwanted exceptions \o/
-
Since it may not be obvious anymore * this package was created as a joke during the Volkswagen emissions scandal in 2015 when software was found in VW vehicules that detected official testing conditions and changed the engine parameters to fake the output of emission of pollutant gases.
It has been adapted in a lot of language and we have a good laugh, thank you all :)
This is in no way a recommended package to use in any other goals than fun or trolling your QA collegues.
Example
Here are the results of running the VWTest case in different environments:
class VWTest extends PHPUnit_Framework_TestCase { private $emissions = 12000; private $legalLimit = 300; public function testEnvironmentalImpactCompliance() { $this->assertLessThan($this->legalLimit, $this->emissions); } }
Running in development environment:
Installation
You can install VW Extension via Composer
composer require hmlb/phpunit-vw:dev-master
Usage
Just enable it by adding the following to your test suite's phpunit.xml file:
<phpunit bootstrap="vendor/autoload.php"> ... <listeners> <listener class="HMLB\PHPUnit\Listener\VWListener" /> </listeners> </phpunit>
Now run your test suite as normal.
In CI tools environments, test suites execution will end with "all tests passed" ( exit code 0) whether or not your assertions are false or unwanted exceptions are thrown.
Configuration
Under the hood (wink wink), the "SecretSoftware" class detects if the phpunit process has been invoked in a CI tools environment. (Actually checks for the most used tools' default environment variables).
If you use another CI tool or want to fool anything else, you can add environment variables to the "scrutiny detection":
additionalEnvVariables - Array of additional environment variables to switch the obfuscation on.
Add this in phpunit.xml when configuring the listener:
<phpunit bootstrap="vendor/autoload.php"> ... <listeners> <listener class="HMLB\PHPUnit\Listener\VWListener" /> <arguments> <array> <element key="additionalEnvVariables"> <array> <element> <string>"FOO_CI"</string> </element> <element> <string>"GOVERNMENT_TEST_TOOL"</string> </element> </array> </element> </array> </arguments> </listener> </listeners> </phpunit>
Scandal
Any similarities with a current event concerning (but not limited to) a multinational automobile manufacturer are purely coincidental.
CI tools detection
Currently detects :
- TravisCI
- Appveyor
- Bamboo
- Buildkite
- CircleCI
- CodeShip
- GitlabCI
- Go CD
- Hudson
- Jenkins
- PHPCI
- TeamCity
- Wercker
Other CI tools using environment variables like 'BUILD_ID' would be detected as well.
License
phpunit-vw is available under the MIT License.
hmlb/phpunit-vw 适用场景与选型建议
hmlb/phpunit-vw 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 113 次下载、GitHub Stars 达 1.76k, 最近一次更新时间为 2015 年 09 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「phpunit」 「extension」 「continuous integration」 「quality」 「hmlb」 「vw」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hmlb/phpunit-vw 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hmlb/phpunit-vw 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hmlb/phpunit-vw 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
HiDev plugin for PHPUnit
Testing Suite For Lumen like Laravel does.
A cli tool which generates unit tests.
A custom URL rule class for Yii 2 which allows to create translated URL rules
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
Lot's of tools for git, file and static source code analysis.
统计信息
- 总下载量: 113
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1759
- 点击次数: 15
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-29