peridot-php/leo-http-foundation 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

peridot-php/leo-http-foundation

最新稳定版本:1.1.0

Composer 安装命令:

composer require peridot-php/leo-http-foundation

包简介

Leo assertions for testing HttpFoundation applications

README 文档

README

#Leo Http Foundation

Leo assertions for use with HttpFoundation

Build Status Scrutinizer Code Quality

This set of assertions is evolving as needed. Please feel free to submit pull requests and make feature requests.

##Usage

You can add HttpFoundation behavior to Leo by extending the Leo assertion property.

$assertion = Leo::assertion();
$assertion->extend(new LeoHttpFoundation());

##Assertions

###->allow(methods, [message])

  • @param array $methods
  • @param string $message [optional]

Checks that the Allowed header is present on the response and that it contains all values passed in the methods array.

expect($response)->to->allow(['POST', 'GET']);
expect($response)->to->not->allow(['GET']);

###->status(status, [message])

  • @param int $status
  • @param string $message [optional]

Asserts that the response status is equal to status.

expect($response)->to->have->status(200);
expect($response)->to->not->have->status(400);

###->json

  • @param bool $assoc [optional]
  • @param int $depth [optional]
  • @param int $options [optional]

A language chain that parses the response body as json and sets it as the subject of the assertion chain. The options parameters for json_decode() may also be included.

expect($response)->json->to->have->property('name');
expect($response)->json->to->loosely->equal($expected);
expect($response)->json(true, 999, JSON_BIGINT_AS_STRING)->to->equal($expected);

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-21