PHPackages                             arielenter/laravel-phpunit-test-validation-rules - 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. arielenter/laravel-phpunit-test-validation-rules

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

arielenter/laravel-phpunit-test-validation-rules
================================================

Assertion methods that help to test that the desired validation rule(s) are implemented in a given URL or route name.

1.3.17(11mo ago)042GPL-3.0PHP

Since Sep 16Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/arielenter/laravel-phpunit-test-validation-rules)[ Packagist](https://packagist.org/packages/arielenter/laravel-phpunit-test-validation-rules)[ RSS](/packages/arielenter-laravel-phpunit-test-validation-rules/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (30)Used By (0)

[Español](https://github.com/arielenter/laravel-phpunit-test-validation-rules/blob/main/README.es.md)

**Package for Laravel Phpunit validation rules testing.**
=========================================================

[](#package-for-laravel-phpunit-validation-rules-testing)

Description
-----------

[](#description)

Trait to be used within TestCase’s tests. It provides assertions to check if a given validation rule is implemented in a given URL or route name for a given request method. One of its more attractive functionality is that it’s possible to test multiple validation rules on one assertion instruccion.

How it works
------------

[](#how-it-works)

A desired validation rule is tested by submitting a provided invalid field value example to a given URL or route name using an established request method and asserting that the expected error message is returned from it. No need to provided the expected error thought. See Assertions Code In A Nutshell section to check in brief how exactly the code does this.

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

[](#installation)

```
composer require --dev arielenter/laravel-phpunit-test-validation-rules
```

Usage
-----

[](#usage)

Say the following routes are in place:

### web.php

[](#webphp)

```
