PHPackages                             sven/laravel-view-assertions - 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-view-assertions

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

sven/laravel-view-assertions
============================

Assert things about your Laravel views in your PHPUnit tests

v1.2.0(2y ago)6426MITPHPPHP ^8.1CI passing

Since Apr 17Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/svenluijten/laravel-view-assertions)[ Packagist](https://packagist.org/packages/sven/laravel-view-assertions)[ RSS](/packages/sven-laravel-view-assertions/feed)WikiDiscussions 1.x Synced today

READMEChangelog (3)Dependencies (3)Versions (6)Used By (0)

[![Laravel View Assertions](https://user-images.githubusercontent.com/11269635/115122193-f2b8e580-9fb6-11eb-9604-eb8ba59cc445.jpg)](https://user-images.githubusercontent.com/11269635/115122193-f2b8e580-9fb6-11eb-9604-eb8ba59cc445.jpg)

Laravel View Assertions
=======================

[](#laravel-view-assertions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2754dcb7861cefe0930c2c45181190bfa731f171b6d5fe31cb41e17d95422e95/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7376656e2f6c61726176656c2d766965772d617373657274696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/laravel-view-assertions)[![Total Downloads](https://camo.githubusercontent.com/dbc0d001a0f83cd552f4e2fbd009e3ab0572f689c8b54a8a314a1c1bdca3eb99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7376656e2f6c61726176656c2d766965772d617373657274696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sven/laravel-view-assertions)[![Software License](https://camo.githubusercontent.com/6c711032aff1ca0eb6b211aa6cb3649ce7fd64a7714e1181d4bb457f9680e7cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/53c56ca4cafd665df43cafd7ead1b41d7f095b7a2d861699851d59edb10d0fb6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7376656e6c75696a74656e2f6c61726176656c2d766965772d617373657274696f6e732f72756e2d74657374732e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/svenluijten/laravel-view-assertions/actions/workflows/run-tests.yml)[![StyleCI](https://camo.githubusercontent.com/5c038871a5ebaffd3417d2b340f568168021e51530fffcde9e08f173bde863fa/68747470733a2f2f7374796c6563692e696f2f7265706f732f3335383932393432302f736869656c64)](https://styleci.io/repos/358929420)

The missing assertions for your views in your Laravel applications.

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-view-assertions --dev
```

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

```
{
    "require-dev": {
        "sven/laravel-view-assertions": "^1.1"
    }
}
```

Usage
-----

[](#usage)

This package exposes a single trait: `\Sven\LaravelViewAssertions\InteractsWithViews`. When you `use` this trait in your tests as below, you'll get access to several assertions:

```
