PHPackages                             sven/laravel-collection-testing-helpers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. sven/laravel-collection-testing-helpers

ActiveLibrary[Testing &amp; Quality](/categories/testing)

sven/laravel-collection-testing-helpers
=======================================

Convenience methods on your Laravel collections for testing

v1.0.0(5y ago)15MITPHPPHP ^8.0CI passing

Since Apr 19Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/svenluijten/laravel-collection-testing-helpers)[ Packagist](https://packagist.org/packages/sven/laravel-collection-testing-helpers)[ RSS](/packages/sven-laravel-collection-testing-helpers/feed)WikiDiscussions 1.x Synced yesterday

READMEChangelogDependencies (2)Versions (4)Used By (0)

[![Laravel Collection Testing Helpers](https://user-images.githubusercontent.com/11269635/115297729-d5be1700-a15c-11eb-9207-8c82d12f1cf7.jpg)](https://user-images.githubusercontent.com/11269635/115297729-d5be1700-a15c-11eb-9207-8c82d12f1cf7.jpg)

Laravel Collection Testing Helpers
==================================

[](#laravel-collection-testing-helpers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1fbd9916395f309b09560ed8da03a09a76d51e4c4737080d2637bc43e887efed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7376656e2f6c61726176656c2d636f6c6c656374696f6e2d74657374696e672d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/laravel-collection-testing-helpers)[![Total Downloads](https://camo.githubusercontent.com/27096781d93e348910c7ceb3aaf92840834a12ff1815b4edf32127804a78cca3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7376656e2f6c61726176656c2d636f6c6c656374696f6e2d74657374696e672d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/laravel-collection-testing-helpers)[![Software License](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d4ddf01810de0997886d76c469e7ec95bd8bcda9b2f0f768b9e94ecbbcc8c9ce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7376656e6c75696a74656e2f6c61726176656c2d636f6c6c656374696f6e2d74657374696e672d68656c706572732f72756e2d74657374732e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/svenluijten/laravel-collection-testing-helpers/actions/workflows/run-tests.yml)[![StyleCI](https://camo.githubusercontent.com/6fe0fb3b0321887efa1db358f9b58793e6f65f18dd995744db2ad2f091eb7a4f/68747470733a2f2f7374796c6563692e696f2f7265706f732f3335393537353135352f736869656c64)](https://styleci.io/repos/359575155)

This package adds several convenience methods to your Laravel collections to make assertions against them more fluent and readable.

Installation
------------

[](#installation)

You'll have to follow a couple of simple steps to install this package.

### Downloading

[](#downloading)

Via [composer](http://getcomposer.org):

```
$ composer require sven/laravel-collection-testing-helpers --dev
```

Or add the package to your development dependencies in `composer.json` and run `composer update` on the command line to download the package:

```
{
    "require-dev": {
        "sven/laravel-collection-testing-helpers": "^1.0"
    }
}
```

Usage
-----

[](#usage)

To use this package in your tests, you must first call the `\Sven\LaravelCollectionTestingHelpers\Helpers::enable()`method where you want to use the assertions. You may then use the methods directly on your collections:

```
