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

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

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

peridot-php/leo

最新稳定版本:1.6.1

Composer 安装命令:

composer require --dev peridot-php/leo

包简介

Next level assertion and matcher library for PHP

README 文档

README

Leo logo

Leo

Next level assertion library for PHP

Current version image Current build status image Current Scrutinizer code quality image Current coverage status image

Visit the main site and documentation at peridot-php.github.io/leo/.

Expect Interface

Leo supports a chainable interface for writing assertions via the expect function:

expect($obj)->to->have->property('name'); expect($value)->to->be->ok expect($fn)->to->throw('InvalidArgumentException', 'Expected message'); expect($array)->to->be->an('array'); expect($result)->to->not->be->empty;

Assert Interface

Leo supports a more object oriented, non-chainable interface via Assert:

use Peridot\Leo\Interfaces\Assert; $assert = new Assert(); $assert->ok(true); $assert->doesNotThrow($fn, 'Exception'); $assert->isResource(tmpfile()); $assert->notEqual($actual, $expected);

Detailed error messages

Leo matchers generate detailed error messages for failed assertions:

Leo messages

Plugins

Leo can be easily customized. For an example see LeoHttpFoundation. Read more on the plugin guide.

Running Tests

make test 

Generating Docs

Documentation is generated via ApiGen. Simply run:

make docs 

Thanks

Leo was inspired by several great projects:

And of course our work on Peridot gave incentive to make a useful complement.

统计信息

  • 总下载量: 365.36k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 36
  • 点击次数: 1
  • 依赖项目数: 64
  • 推荐数: 0

GitHub 信息

  • Stars: 36
  • Watchers: 3
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固