soyhuce/pest-plugin-laravel 问题修复 & 功能扩展

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

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

soyhuce/pest-plugin-laravel

Composer 安装命令:

composer require --dev soyhuce/pest-plugin-laravel

包简介

Custom extensions for Laravel integration into Pest

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub static analysis Action Status GitHub Pint Action Status Total Downloads

Installation

You can install the package via composer:

composer require soyhuce/pest-plugin-laravel --dev

Usage

Expectations

  • toBeModel expects that the value matches current model
expect($model)->toBeModel($expectedModel)
  • toBeCollection expects that the collection matches current collection
expect($collection)->toBeCollection(new Collection([1,2,3]));
/// Expected collection can be given as array
expect($collection)->toBeCollection([1,2,3]);

Keys and order of the collections are checked and must match.

  • toBeCollectionCanonicalizing expects that the collection matches current collection, ignoring order
expect($collection)->toBeCollectionCanonicalizing(new Collection([1,2,3]));
/// Expected collection can be given as array
expect($collection)->toBeCollectionCanonicalizing([3,1,2]);

Keys of the collections are checked and must match.

  • toBeAbleTo expect that the autenticatable can perform the given action
expect($user)->toBeAbleTo('update', $post);

Data expectations : require spatie/laravel-data package

  • toBeData expects that the value matches current data object
expect($data)->toBeData(new UserData(['name' => 'John Doe']));
  • toBeDataCollection expects that the collection matches current data collection
expect($dataCollection)->toBeDataCollection(new UserDataCollection([
    new UserData(['name' => 'John Doe']),
    new UserData(['name' => 'Jane Doe']),
]));

// Expected collection can be given as array
expect($dataCollection)->toBeDataCollection([['name' => 'John Doe'], ['name' => 'Jane Doe']]);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固