承接 kazu9su/functional-tester 相关项目开发

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

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

kazu9su/functional-tester

Composer 安装命令:

composer require kazu9su/functional-tester

包简介

This is a library for functional test of PHP legacy products

README 文档

README

Build Status

This is a library for functional test of PHP legacy products.
If you have difficulty with testing such products, this library can help you.

Usage

First, create a new "FunctionalTester" instance.

You can set session, document root and include paths used in your target product.

If you call request method like http request, you can get a parsed response instance of GuzzleHttp\Message\Response

use FunctionalTester/FunctionalTester;

class IndexTest extends PHPUnit_Framework_TestCase
{
    public function testIndex
    {
        $tester = new FunctionalTester();
        
        //set session used in your target product.
        $tester->setSession(['id' => 'hogehoge']);
        
        //set your document root. you can also set as constructer 1st argument.
        $tester->setDocumentRoot('/path/to/src');
        
        //set include path used in your target product. you can also set as constructer 2nd argument.
        $tester->setIncludePath('.:/usr/bin/php');

        //you can also add
        $tester->addIncludePath(':/path/to/src');
        
        //you can call get or post method like http request
        $response = $tester->get('index.php', ['username' => 'hogehoge']);
        
        //you can assert request results like this.
        $this->assertEquals(200, $response->getStatusCode());
        $this->assertEquals('OK', $response->getBody());
    }
}

Installation

You can install this library through Composer .

$ composer require kazu9su/functional-tester

This will install FunctionalTester and all required dependencies.

Tests

To execute the test suite, you'll need phpunit.

$ phpunit

License

The FunctionalTester is licensed under the MIT license. See License File for more information.

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固