yegor256/phprack
Composer 安装命令:
composer require yegor256/phprack
包简介
Light framework for automation of integration tests
关键字:
README 文档
README
Read about phpRack in php|Architect June 2010: Integration Testing with phpRack Framework.
phpRack is a lightweight framework for integration test automation. Integration tests are checks that run in the production environment to validate that it is configured as expected. For example, your product is a web application that depends on PHP, Apache, MySQL, and the availability of YouTube, Flickr, and Google Maps APIs. Your product is tested with unit tests that use stubs for these services and components. When the product is deployed to production, you want to be sure that the services you need are configured and available. If they are not, you want a detailed notification before your end-users notice.
This is where phpRack helps. Add phpRack to your project and write a few tests. All these tests will be executed when requested and will produce a detailed report, both online and by email. It will save you a lot of time during deployment and later, during maintenance of your product.
To start using phpRack, follow these three steps:
- Upload phpRack library to your server
- Create
phprack.phpfile in yourpublic_htmldirectory - Create PHP integration tests in your rack-tests directory
Let's do them one by one:
Download ZIP archive
of phpRack and unpack it to public_html/phpRack or some other directory on
your production server.
Create phprack.php in your project's public directory
(see full reference), e.g.:
<?php // this param is mandatory, others are optional $phpRackConfig = array( 'dir' => '../rack-tests', ); // absolute path to the bootstrap script on your server include '../library/phpRack/bootstrap.php';
Write integration tests in the rack-tests directory. Each test must extend
phpRack_Test (see
full list of assertions).
For example, file MyTest.php:
<?php class MyTest extends phpRack_Test { public function testPhpVersionIsCorrect() { $this->assert->php->version ->atLeast('5.2'); } public function testPhpExtensionsExist() { $this->assert->php->extensions ->isLoaded('xsl') ->isLoaded('simplexml') ->isLoaded('fileinfo'); } }
Go to this URL: http://your-website-url/phprack.php and enjoy.
Try this link to see what you're going to see on your site:
http://www.phprack.com/phprack.php.
How to contribute?
Fork the repository, clone it to your local machine, and install dependencies:
composer install
Then run the build:
./vendor/bin/phing
All tests should pass. If you see any problems, please submit a new issue.
After making your changes, run phing again to make sure you didn't break anything.
When ready, submit a pull request.
yegor256/phprack 适用场景与选型建议
yegor256/phprack 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.67k 次下载、GitHub Stars 达 25, 最近一次更新时间为 2015 年 03 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「test」 「deployment」 「integration」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 yegor256/phprack 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 yegor256/phprack 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 yegor256/phprack 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Testing Suite For Lumen like Laravel does.
Automated deployment template for Laravel Envoy based on Capistrano.
Morpht Development Tools
blueways deployer recipes
A Highly Opinionated Symfony3/4 Deployer Recipe
A Deployment/Change Log Schedule and Notes system for SilverStripe sites
统计信息
- 总下载量: 4.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-03-13