承接 vmpublishing/psr15-middleware-test-helpers 相关项目开发

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

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

vmpublishing/psr15-middleware-test-helpers

Composer 安装命令:

composer require vmpublishing/psr15-middleware-test-helpers

包简介

couple of often reused mocks for testing psr-15 middlewares

README 文档

README

Code Coverage Scrutinizer Code Quality Build Status

WHAT

a collection of reusable mocks for phpunit for the common middleware-related interfaces

INSTALL

To install simply use composer require vmpublishing/psr15-middleware-test-helpers

USE

As these are traits, just use them inside your testcase:


class SomeTest extends TestCase
{
    use VM\Psr15Mocks\Middleware; // include to use
    // this will generate the member variables:
    // $request
    // $response
    // $requestHandler
    // $body

    // ..

    // create them all properly
    public function setUp(): void
    {
        $this->buildResponse();
        $this->buildRequest();
        $this->buildRequestHandler();
        $this->buildBody();
    }

    // destroy them all properly
    public function tearDown(): void
    {
        $this->destroyBody();
        $this->destroyRequestHandler();
        $this->destroyRequest();
        $this->destroyResponse();
    }

    // ..

    public function testSomething(): void
    {
        // use to validate calls
        $this->response->expects($this->once())->method('getBody')->willReturn($this->body);
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固