🧑‍🔬 The missing assertions for your views in your Laravel applications.

Overview

Laravel View Assertions

Laravel View Assertions

Latest Version on Packagist Total Downloads Software License Build Status StyleCI

The missing assertions for your views in your Laravel applications.

Installation

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

Downloading

Via composer:

$ 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

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:

<?php

use Sven\LaravelViewAssertions\InteractsWithViews;
use Illuminate\Foundation\Testing\TestCase;

class ExampleTest extends TestCase
{
    use InteractsWithViews;

    public function test_it_creates_a_view()
    {
        // ...
        
        $this->assertViewExists('some.view-file');
        $this->assertViewsExist(['posts.index', 'posts.show']);
    }

    public function test_it_does_not_create_a_view()
    {
        // ...
        
        $this->assertViewDoesNotExist('some.view-file');
        $this->assertViewsDoNotExist(['posts.edit', 'posts.create']);
    }

    public function test_the_view_equals()
    {
        // ...
        
        $this->assertViewEquals('The Expected Contents', 'index');
    }

    public function test_the_view_does_not_equal()
    {
        // ...
        
        $this->assertViewDoesNotEqual('This Is Not The Content You\'re Looking For', 'index');
    }
}

Contributing

All contributions (pull requests, issues and feature requests) are welcome. Make sure to read through the CONTRIBUTING.md first, though. See the contributors page for all contributors.

License

sven/laravel-view-assertions is licensed under the MIT License (MIT). Please see the license file for more information.

You might also like...
Voyager - The Missing Laravel Admin
Voyager - The Missing Laravel Admin

Voyager - The Missing Laravel Admin Made with ❤️ by The Control Group Website & Documentation: https://voyager.devdojo.com/ Video Tutorial Here: https

Missing pet flyer - Laravel 4 application

Laravel 4.0 Application - Pet Flyer generator Features This is the source of http://missingpetflyer.com that is deployed to Pagodabox. This applicatio

A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Provides the missing range field for the Filament forms.
Provides the missing range field for the Filament forms.

The missing range field for the Filament forms. Installation You can install the package via composer: composer require yepsua/filament-range-field Pu

Create Laravel views (blade template) using 'php artisan' command-line interface
Create Laravel views (blade template) using 'php artisan' command-line interface

About LaraBit Have you ever wonder to create Laravel views (Blade Templates) using the same type of artisan commands that you usually use to create ne

Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology.
Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology.

Stash View Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology. What is Russian Doll Caching ? It i

Slim Framework custom views

Slim Views This repository contains custom View classes for the template frameworks listed below. You can use any of these custom View classes by eith

Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications.
Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications.

Laravel Boilerplate Project Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications. Table of Con

This package lets you add uuid as primary key in your laravel applications

laravel-model-uuid A Laravel package to add uuid to models Table of contents Installation Configuration Model Uuid Publishing files / configurations I

Comments
Owner
Sven Luijten
I build stuff for the web.
Sven Luijten
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

WebDevEtc. 227 Dec 25, 2022
đź‘€ Manage your views in Laravel projects through artisan

Artisan View This package adds a handful of view-related commands to Artisan in your Laravel project. Generate blade files that extend other views, sc

Sven Luijten 842 Dec 29, 2022
A package to easily make use of Iconic icons in your Laravel Blade views.

Blade Iconic A package to easily make use of Iconic icons in your Laravel Blade views. For a full list of available icons see the SVG directory. Iconi

Malik Alleyne-Jones 17 Aug 25, 2022
A package to easily make use of Simple Icons in your Laravel Blade views.

Blade Simple Icons A package to easily make use of Simple Icons in your Laravel Blade views. For a full list of available icons see the SVG directory.

UB Labs 12 Jan 17, 2022
Cagilo - a set of simple components for use in your views Laravel Blade.

Cagilo - a set of simple components for use in your views Laravel Blade. Official Documentation Documentation for Cagilo can be found on its we

Cagilo 151 Dec 6, 2022
Take a look into your Laravel views

Xray - Take a look into your Laravel views When your Laravel project grows, so do the Laravel views. Sometimes it might be hard to figure out, which p

Beyond Code 572 Aug 6, 2022
A package to easily make use of SVG icons in your Laravel Blade views.

Blade Icons A package to easily make use of SVG icons in your Laravel Blade views. Originally "Blade SVG" by Adam Wathan. Turn... <!-- camera.svg -->

Blade UI Kit 1.7k Jan 2, 2023
Blade UI Kit is a set of renderless components to utilise in your Laravel Blade views

Blade UI Kit is a set of renderless components to utilise in your Laravel Blade views. In all essence, it's a collection of useful utilities, connecting the dots between different parts of the TALL stack. It was made for Blade, Laravel's powerful templating engine.

Blade UI Kit 1.2k Jan 5, 2023
A package to easily make use of Iconsax in your Laravel Blade views.

Blade Iconsax A package to easily make use of Iconsax in your Laravel Blade views. This package contains 1.000 icons in 6 diferent styles, a total of

Guilherme Saade 4 Oct 22, 2022
The Missing Laravel Commands

Made with ❤️ by SecTheater Foundation Artify CheatSheet will be availble soon Laravel is a great framework and it provides us the ability to create ou

Security Theater 91 Oct 13, 2022