承接 yegor256/phprack 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yegor256/phprack

最新稳定版本:1.1

Composer 安装命令:

composer require yegor256/phprack

包简介

Light framework for automation of integration tests

README 文档

README

DevOps By Rultor.com

phing PDD status Hits-of-Code

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.php file in your public_html directory
  • 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.

统计信息

  • 总下载量: 4.67k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 25
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 25
  • Watchers: 3
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-03-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固